Add agent

This commit is contained in:
Oscar 2021-08-21 01:08:02 -05:00
parent 77e8ce7f3a
commit 294afae0e0
5 changed files with 42 additions and 0 deletions

View File

@ -3,6 +3,7 @@
from trytond.pool import Pool
from . import sale
from . import dash
from . import party
def register():
@ -11,4 +12,5 @@ def register():
sale.AppDelivery,
sale.AppSaleOrder,
dash.DashApp,
party.Party,
module='dash_sale', type_='model')

9
party.py Normal file
View File

@ -0,0 +1,9 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields
from trytond.pool import PoolMeta
class Party(metaclass=PoolMeta):
__name__ = 'party.party'
agent = fields.Many2One('commission.agent', 'Agent')

12
party.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="party_view_form">
<field name="model">party.party</field>
<field name="inherit" ref="party.party_view_form"/>
<field name="name">party_form</field>
</record>
</data>
</tryton>

View File

@ -11,3 +11,4 @@ depends:
dash
xml:
sale.xml
party.xml

18
view/party_form.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath
expr="/form/notebook/page[@id='sale']/field[@name='sale_price_list']"
position="after">
<label name="zone"/>
<field name="zone"/>
</xpath>
<xpath
expr="/form/notebook/page[@id='sale']/field[@name='sale_price_list']"
position="after">
<label name="agent"/>
<field name="agent"/>
</xpath>
</data>