diff --git a/cor_custom/models/__init__.py b/cor_custom/models/__init__.py index 26b5d89..1bcbe44 100755 --- a/cor_custom/models/__init__.py +++ b/cor_custom/models/__init__.py @@ -7,3 +7,4 @@ from . import project_overview from . import analytic from . import product from . import hr_employee +from . import sale diff --git a/cor_custom/models/sale.py b/cor_custom/models/sale.py new file mode 100755 index 0000000..d4e2c02 --- /dev/null +++ b/cor_custom/models/sale.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- + +from odoo import api, fields, models, _ + + +class SaleInherit(models.Model): + _inherit = 'sale.order' + + partner_id = fields.Many2one( + 'res.partner', string='Client', readonly=True, + states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, + required=True, change_default=True, index=True, tracking=1, + domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",) diff --git a/cor_custom/views/sale_views.xml b/cor_custom/views/sale_views.xml index 3b3d554..bdcb2e2 100755 --- a/cor_custom/views/sale_views.xml +++ b/cor_custom/views/sale_views.xml @@ -6,11 +6,11 @@ sale.order - +