Fix: Add field date, xmls

This commit is contained in:
cosmos 2025-01-29 15:19:19 -05:00
parent 0487da7a65
commit 096386d8f7
7 changed files with 48 additions and 9 deletions

View File

@ -6,6 +6,7 @@ from trytond.transaction import Transaction
from trytond.modules.currency.fields import Monetary
from trytond.modules.product import price_digits
from decimal import Decimal
from datetime import date
class SaleOrder(ModelView, ModelSQL):
@ -22,6 +23,11 @@ class SaleOrder(ModelView, ModelSQL):
lines = fields.One2Many(
'order.line', 'order', 'Lines'
)
date = fields.Date("Date", required=True)
@staticmethod
def default_date():
return date.today()
class OrderLine(ModelView, ModelSQL):

View File

@ -23,5 +23,27 @@ this repository contains the full copyright notices and license terms. -->
<field name="type">form</field>
<field name="name">line_form</field>
</record>
<record model="ir.action.act_window" id="act_sale_order">
<field name="name">Order</field>
<field name="res_model">sale.order</field>
</record>
<record model="ir.action.act_window.view"
id="act_sale_order_view1">
<field name="sequence" eval="1"/>
<field name="view" ref="sale_order_view_tree"/>
<field name="act_window" ref="act_sale_order"/>
</record>
<record model="ir.action.act_window.view"
id="act_sale_order_view2">
<field name="sequence" eval="2"/>
<field name="view" ref="sale_order_view_form"/>
<field name="act_window" ref="act_sale_order"/>
</record>
<menuitem
name="Order"
action="act_sale_order"
sequence="80"
id="menu_order"
icon="tryton-folder"/>
</data>
</tryton>

View File

@ -1,5 +1,5 @@
[tryton]
version=7.4
version=7.4.0
depends:
ir
party

View File

@ -2,4 +2,12 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
<group col="2" id="line">
<label name="product"/>
<field name="product"/>
<label name="quantity"/>
<field name="quantity"/>
<label name="total_amount"/>
<field name="total_amount"/>
</group>
</form>

View File

@ -2,4 +2,7 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
</tree>
<field name="product"/>
<field name="quantity"/>
<field name="total_amount"/>
</tree>

View File

@ -6,9 +6,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="party"/>
<label name="pickup_location"/>
<field name="pickup_location"/>
<notebook colspan="4">
<page string="Order Lines" col="1" id="line">
<field name=""/>
</page>
</notebook>
<label name="date"/>
<field name="date"/>
<field name="lines" colspan="4"
view_ids="sale_order.order_line_view_tree,sale_order.order_line_view_form"/>
</form>

View File

@ -2,6 +2,7 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree keyword_open="1">
<field name="party" expand="1"/>
<field name="pickup_location" expand="1"/>
<field name="party"/>
<field name="pickup_location"/>
<field name="date"/>
</tree>