Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] sale_property: new module to add property fields #205

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sale_property/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
25 changes: 25 additions & 0 deletions sale_property/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
2 changes: 2 additions & 0 deletions sale_property/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import crm_team
from . import sale_order
11 changes: 11 additions & 0 deletions sale_property/models/crm_team.py
Original file line number Diff line number Diff line change
@@ -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')


10 changes: 10 additions & 0 deletions sale_property/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -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)
25 changes: 25 additions & 0 deletions sale_property/views/sale_order_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<odoo>
<record id="sale_order_form_properties" model="ir.ui.view">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<field name="payment_term_id" position="after">
<field name="sale_order_properties"/>
</field>
</field>
</record>

<record id="view_order_tree_properties" model="ir.ui.view">
<field name="name">sale.order.tree.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<field name="amount_total" position="after">
<field name="sale_order_properties" optional="hidden"/>
</field>
</field>
</record>

</odoo>