c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #13568
[Bug 705797] Re: [trunk][account][low] Inversion of two columns in a many2many field
Note that this should appears frequently if the documentation give 2
versions of "how make a many2many". Have a look :
http://doc.openerp.com/developer/2_5_Objects_Fields_Methods/field_type.html
#relational-types
First we read this :
fields.many2many('other.object.name',
'relation object',
'actual.object.id',
'other.object.id',
'Field Name')
Then we read this :
class other_object_name2(osv.osv):
_inherit = 'other.object.name'
_columns = {
'other_fields': fields.many2many(
'actual.object.name',
'relation object',
'actual.object.id',
'other.object.id',
'Other Field Name'),
}
other_object_name2()
The other.object.id is at the fourth place, then @t third place.
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/705797
Title:
[trunk][account][low] Inversion of two columns in a many2many field
Status in OpenERP Modules (addons):
New
Bug description:
Addons: revno. 4372
By browsing the table account_bank_statement_line_move_rel in a database created with the trunk, I see that this table have two columns :
- move_id
- statement_id
The first should refers to account_move, the second to
account_bank_statement.
By using openerp, I have some values inserted into the database. It
seems that move_id contains values that should be in statement_id and
inversely.
In fact it's easy to change this. You just have to go to
account/account_bank_statement.py#465-467 and change lines :
'move_ids': fields.many2many('account.move',
'account_bank_statement_line_move_rel', 'move_id','statement_id',
'Moves'),
by :
'move_ids': fields.many2many('account.move',
'account_bank_statement_line_move_rel', 'statement_id','move_id',
'Moves'),
It's not so important because of ORM methods use (like browse, etc.).
But imagine someone develop a module which use a sql query like in
account/account_move_line.py#786-790 but on
account_bank_statement_line_move_rel ... that will affect the
developer's result.
Thanks for advance about this non-critical bug but important for those
who parses the database and develops modules ;)
References