diff --git a/sale_partner_shipping_invoice_domain/README.rst b/sale_partner_shipping_invoice_domain/README.rst new file mode 100644 index 0000000..7d7e1d0 --- /dev/null +++ b/sale_partner_shipping_invoice_domain/README.rst @@ -0,0 +1,91 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================ +Sale Shipping Address Domain +============================ + +Adds a sensible domain to the shipping address on sale form view + +Installation +============ + +To install this module, you need to: + +#. Do this ... + +Configuration +============= + +To configure this module, you need to: + +#. Go to ... + +.. figure:: path/to/local/image.png + :alt: alternative description + :width: 600 px + +Usage +===== + +To use this module, you need to: + +#. Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch} + +.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt +.. branch is "8.0" for example + +Known issues / Roadmap +====================== + +* ... + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Firstname Lastname +* Second Person + +Funders +------- + +The development of this module has been financially supported by: + +* Company 1 name +* Company 2 name + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/sale_partner_shipping_invoice_domain/__init__.py b/sale_partner_shipping_invoice_domain/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/sale_partner_shipping_invoice_domain/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_partner_shipping_invoice_domain/__manifest__.py b/sale_partner_shipping_invoice_domain/__manifest__.py new file mode 100644 index 0000000..0e322aa --- /dev/null +++ b/sale_partner_shipping_invoice_domain/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2021 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Sale Shipping and Invoice Domain", + "summary": """ + Adds a sensible domain to the shipping and invoicing addresses on sale form view""", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "Akretion,Odoo Community Association (OCA)", + "depends": ["sale_stock", "sale_commercial_partner"], + "demo": [], +} diff --git a/sale_partner_shipping_invoice_domain/models/__init__.py b/sale_partner_shipping_invoice_domain/models/__init__.py new file mode 100644 index 0000000..6aacb75 --- /dev/null +++ b/sale_partner_shipping_invoice_domain/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/sale_partner_shipping_invoice_domain/models/sale_order.py b/sale_partner_shipping_invoice_domain/models/sale_order.py new file mode 100644 index 0000000..0a58c60 --- /dev/null +++ b/sale_partner_shipping_invoice_domain/models/sale_order.py @@ -0,0 +1,19 @@ +# Copyright 2021 Akretion France (http://www.akretion.com/) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + partner_invoice_id = fields.Many2one( + domain="['&', '|', " + "('company_id', '=', False), ('company_id', '=', company_id)," + "('id', 'child_of', commercial_partner_id)]" + ) + partner_shipping_id = fields.Many2one( + domain="['&', '|', " + "('company_id', '=', False), ('company_id', '=', company_id)," + "('id', 'child_of', commercial_partner_id)]" + ) diff --git a/sale_partner_shipping_invoice_domain/static/description/icon.png b/sale_partner_shipping_invoice_domain/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/sale_partner_shipping_invoice_domain/static/description/icon.png differ