I don't know if i understand your question or not, just think about the many2many creates a table in the DB with the name 'relation object' and 2 columns, one will be named 'actual.object.id' which openerp will store the id of the current object there and the other column 'other.object.id' which will store the id of the related object there.
Yo can name them as you want, for example:
Code:
class addonname_objectA(osv.osv):
...
_columns = {
'relation_A2B_id':fields.many2many('addonname.objectB','rel_table_name','rel_id_a','rel_id_b','Some name here'),
In this case, objectB should be declared before this relation, and so if you want to relate B with A, you should extend the objectB after objectA and inverte the relation
Code:
class addonname_objectB_ext(osv.osv):
...
_inherit = "addonname.objectB"
_columns = {
'relation_B2A_id':fields.many2many('addonname.objectA','rel_table_name','rel_id_b','rel_id_a','Some name here'),