partner functions - ref=not null, but not in Form

Bug #323638 reported by Ferdinand
2
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

in res_partner_functions there is a field "ref" mandatory, but not enterable

so no new records can be created

IMHO it's been replaced by code.

Revision history for this message
Ferdinand (office-chricar) wrote :

IMHO a nonsense
code may be unique not ref - Notes may never be unique !
if code is unique it must be mandatory

class res_partner_function(osv.osv):
    _name = 'res.partner.function'
    _description = 'Function of the contact'
    _columns = {
        'name': fields.char('Function Name', size=64, required=True),
        'code': fields.char('Code', size=8),
        'ref':fields.char('Notes', size=32, required=True),
    }
    _order = 'name'
    _sql_constraints = [
        ('ref_uniq', 'unique (ref)', 'The Notes of the Partner Function must be unique !')
    ]
res_partner_function()

Revision history for this message
Ferdinand (office-chricar) wrote :
Revision history for this message
Ferdinand (office-chricar) wrote :

the code field seems not too be used anywhere

Revision history for this message
Husen Daudi (husendaudi) wrote :

We should remove ref fields instead of code.
Here we can create new functions without ref field too.
terp=# select * from res_partner_function;
 id | create_uid | create_date | write_date | write_uid | code | name | ref
----+------------+----------------------------+----------------------------+-----------+------+-------------------------+-----
  1 | 1 | 2009-01-19 17:28:05.892674 | | | CEO | Director |
  2 | 1 | 2009-01-19 17:28:05.892674 | | | CTO | Chief Technical Officer|
  3 | 1 | 2009-01-19 17:28:05.892674 | | | | Salesman |
  4 | 1 | 2009-01-19 17:29:52.981644 | | | | Private Address |
  5 | 1 | 2009-02-02 17:10:14.544799 | | 1 | test | Test |

Revision history for this message
Ferdinand (office-chricar) wrote :

SHOWSTOPPER !!
something has to be done - NEW functions cant be saved now

Revision history for this message
Husen Daudi (husendaudi) wrote :

Fixed in trunk with this patch.

Revision history for this message
Ferdinand (office-chricar) wrote :

I just want to remark that in the same module for res_partner we have
....
        'ref': fields.char('Code', size=64),
...
        'comment': fields.text('Notes'),

IMHO we should try to stick to a common naming in a module

Revision history for this message
Ferdinand (office-chricar) wrote :

BTW - IMHO the demo data must be changed too

DB Creation fails now

[Tue Feb 03 2009 10:45:50] INFO:init:module base: loading res/partner/partner_data.xml
[Tue Feb 03 2009 10:45:51] ERROR:sql:bad query: insert into "res_partner_function" (id,"ref","name",create_uid,create_date) values (1,E'CEO',E'Director',1,now())
[Tue Feb 03 2009 10:45:51] ERROR:init:[01]: <record id="function_director" model="res.partner.function">
[Tue Feb 03 2009 10:45:51] ERROR:init:[02]: <field name="name">Director</field>
[Tue Feb 03 2009 10:45:51] ERROR:init:[03]: <field name="ref">CEO</field>
[Tue Feb 03 2009 10:45:51] ERROR:init:[04]: </record>
[Tue Feb 03 2009 10:45:51] ERROR:web-services:[01]: CREATE DATABASE

Revision history for this message
Ferdinand (office-chricar) wrote :

BTW create DB fails even with NO demo data !!!! - because functions are always loaded

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Hello ,
fixed in trunk
         openobject-addons - 2204 rev no
         openobject-server - 1692 rev no
Thanks,

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

it's fixed now.

Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.