Feat:Se agrega vista a 'sale_form

This commit is contained in:
Mongar28 2024-08-15 11:03:50 -05:00
parent 7dab4ef9ce
commit 77c5fd858e
7 changed files with 25 additions and 7 deletions

View File

@ -6,3 +6,4 @@ depends:
company
sale
xml:
sale.xml

View File

@ -1,6 +1,5 @@
from trytond.pool import PoolMeta, Pool
from trytond.model import fields, ModelSQL, ModelView
from trytond.pyson import Eval
from trytond.transaction import Transaction
@ -12,7 +11,7 @@ class Sale(metaclass=PoolMeta):
'sale',
"Delete lines",
states={
'readonly': Eval('state') != 'draft'
'readonly': True
}
)

View File

@ -1,5 +1,11 @@
<tryton>
<data>
<data>
<record model="ir.ui.view" id="sale_view_form">
<field name="model">sale.sale</field>
<field name="inherit" ref="sale.sale_view_form"/>
<field name="name">sale_form</field>
</record>
<record model="ir.ui.view" id="sale_line_deleted_view_form">
<field name="model">sale.line_deleted</field>
<field name="type">form</field>

View File

@ -6,11 +6,15 @@ README.rst
setup.py
./__init__.py
./sale.py
./sale.xml
./tryton.cfg
./tests/__init__.py
./tests/scenario_sale_line_delete_log.rst
./tests/test_module.py
./tests/test_scenario.py
./view/sale_form.xml
./view/sale_line_deleted_form.xml
./view/sale_line_deleted_list.xml
doc/conf.py
doc/configuration.rst
doc/design.rst

8
view/sale_form.xml Normal file
View File

@ -0,0 +1,8 @@
<?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="//field[@name='lines']" position="after">
<field name="delete_lines" colspan="4"/>
</xpath>
</data>

View File

@ -3,10 +3,10 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="sale"/>
<field name="user"/>
<field name="sale_date"/>
<field name="product"/>
<field name="quantity"/>
<field name="unit"/>
<field name="product"/>
<field name="sale_date"/>
<field name="user"/>
<field name="sale"/>
</tree>