commit 3135a41ed56c6076dabc3a964b77508226eb1ee8 Author: Marc Durepos Date: Mon Jun 19 11:07:39 2023 -0400 bemade_partner_root_ancestor: initial commit diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/__manifest__.py b/__manifest__.py new file mode 100644 index 0000000..52d08de --- /dev/null +++ b/__manifest__.py @@ -0,0 +1,35 @@ +# +# Bemade Inc. +# +# Copyright (C) June 2023 Bemade Inc. (). +# Author: mdurepos (Contact : it@bemade.org) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the Software +# or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +{ + 'name': 'bemade_multiple_billing_contacts', + 'version': '15.0.1.0.0', + 'summary': 'Send invoices to multiple contacts by default.', + 'description': """By default, newly created invoices add all invoice addresses for the given partner as + followers on the invoice. If billing contacts are set manually on the sales order, those billing + contacts are added as followers on the invoice instead.""", + 'category': 'Invoicing Management', + 'author': 'Bemade Inc.', + 'website': 'https://www.bemade.org', + 'license': 'OPL-1', + 'depends': ['sale', 'account'], + 'data': [], + 'demo': [], + 'installable': True, + 'auto_install': False, +} diff --git a/models/__init__.py b/models/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/models/__init__.py @@ -0,0 +1 @@ + diff --git a/models/account_move.py b/models/account_move.py new file mode 100644 index 0000000..e69de29 diff --git a/models/res_partner.py b/models/res_partner.py new file mode 100644 index 0000000..fa220a5 --- /dev/null +++ b/models/res_partner.py @@ -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) \ No newline at end of file diff --git a/models/sale_order.py b/models/sale_order.py new file mode 100644 index 0000000..ed1dad9 --- /dev/null +++ b/models/sale_order.py @@ -0,0 +1,6 @@ +from odoo import models, fields, api, _, Command + + +class SaleOrder(models.Model): + _inherit = 'sale.order' +