bemade_multiple_billing_contacts: Initial commit.
This commit is contained in:
parent
02a711f42a
commit
687a30ea90
4 changed files with 23 additions and 1 deletions
|
|
@ -27,7 +27,7 @@
|
||||||
'author': 'Bemade Inc.',
|
'author': 'Bemade Inc.',
|
||||||
'website': 'https://www.bemade.org',
|
'website': 'https://www.bemade.org',
|
||||||
'license': 'OPL-1',
|
'license': 'OPL-1',
|
||||||
'depends': [],
|
'depends': ['sale', 'account'],
|
||||||
'data': [],
|
'data': [],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|
|
||||||
0
models/account_move.py
Normal file
0
models/account_move.py
Normal file
16
models/res_partner.py
Normal file
16
models/res_partner.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
from odoo import models, fields, api, _, Command
|
||||||
|
|
||||||
|
|
||||||
|
class Partner(models.Model):
|
||||||
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
def _billing_contacts_domain(self):
|
||||||
|
self.ensure_one()
|
||||||
|
return [('is_company', '=', False), ('root_ancestor', '=', self.root_ancestor)]
|
||||||
|
billing_contacts = fields.Many2many(string='Default Billing Contacts',
|
||||||
|
comodel_name='res.partner',
|
||||||
|
relation='res_partner_billing_contact_rel',
|
||||||
|
column1='billing_contact_id',
|
||||||
|
column2='billed_partner_id',
|
||||||
|
domain=_billing_contacts_domain,
|
||||||
|
tracking=True)
|
||||||
6
models/sale_order.py
Normal file
6
models/sale_order.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
from odoo import models, fields, api, _, Command
|
||||||
|
|
||||||
|
|
||||||
|
class SaleOrder(models.Model):
|
||||||
|
_inherit = 'sale.order'
|
||||||
|
|
||||||
Loading…
Reference in a new issue