From 87cd5ff24f712da8ccd44a610aaf0a6628088fa6 Mon Sep 17 00:00:00 2001 From: Celina Devigili Date: Thu, 15 Aug 2024 09:41:58 -0300 Subject: [PATCH] [ADD] sale_property: new module to add property fields --- sale_property/__init__.py | 1 + sale_property/__manifest__.py | 25 ++++++++++++++++++++++++ sale_property/models/__init__.py | 2 ++ sale_property/models/crm_team.py | 11 +++++++++++ sale_property/models/sale_order.py | 10 ++++++++++ sale_property/views/sale_order_views.xml | 25 ++++++++++++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 sale_property/__init__.py create mode 100644 sale_property/__manifest__.py create mode 100644 sale_property/models/__init__.py create mode 100644 sale_property/models/crm_team.py create mode 100644 sale_property/models/sale_order.py create mode 100644 sale_property/views/sale_order_views.xml diff --git a/sale_property/__init__.py b/sale_property/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/sale_property/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_property/__manifest__.py b/sale_property/__manifest__.py new file mode 100644 index 00000000..6a5778c7 --- /dev/null +++ b/sale_property/__manifest__.py @@ -0,0 +1,25 @@ +{ + 'name': 'sale_property', + 'version': "17.0.0.0.0", + 'category': '', + 'summary': 'Implements property fields to Sale Team and Sale Order models.', + 'description': """ + This module adds property fields to the Sale Team and Sale Order models. + """, + 'author': 'ADHOC SA', + 'website': 'www.adhoc.com.ar', + 'license': 'AGPL-3', + 'depends': [ + 'sale', + 'crm', + ], + 'data':[ + 'views/sale_order_views.xml' + ], + 'demo':[ + + ], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/sale_property/models/__init__.py b/sale_property/models/__init__.py new file mode 100644 index 00000000..1e4ddb08 --- /dev/null +++ b/sale_property/models/__init__.py @@ -0,0 +1,2 @@ +from . import crm_team +from . import sale_order diff --git a/sale_property/models/crm_team.py b/sale_property/models/crm_team.py new file mode 100644 index 00000000..a599e147 --- /dev/null +++ b/sale_property/models/crm_team.py @@ -0,0 +1,11 @@ +from odoo import models, fields + + +class CrmTeam(models.Model): + + _inherit = 'crm.team' + + + sale_order_properties_definition = fields.PropertiesDefinition('Sale Order Properties') + + diff --git a/sale_property/models/sale_order.py b/sale_property/models/sale_order.py new file mode 100644 index 00000000..80405f95 --- /dev/null +++ b/sale_property/models/sale_order.py @@ -0,0 +1,10 @@ +from odoo import models, fields + +class SaleOrder(models.Model): + + _inherit = 'sale.order' + + + sale_order_properties = fields.Properties( + 'Properties', definition='team_id.sale_order_properties_definition', + copy=True) diff --git a/sale_property/views/sale_order_views.xml b/sale_property/views/sale_order_views.xml new file mode 100644 index 00000000..16a92866 --- /dev/null +++ b/sale_property/views/sale_order_views.xml @@ -0,0 +1,25 @@ + + + + sale.order.form.inherit + sale.order + + + + + + + + + + sale.order.tree.inherit + sale.order + + + + + + + + +