Skip to content

Commit

Permalink
[14.0][IMP] custom_p: Add lines in bottom of sale line tree view.
Browse files Browse the repository at this point in the history
  • Loading branch information
Berezi committed Dec 18, 2024
1 parent 8a49b6b commit 1dcc718
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 15 deletions.
2 changes: 1 addition & 1 deletion custom_p/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def button_return_picking(self):

def action_view_sale_lines(self):
result = super().action_view_sale_lines()
view_tree_id = self.env.ref("custom_p.view_sales_order_line_input_tree").id
view_tree_id = self.env.ref("custom_p.view_order_line_tree").id
result["views"] = [(view_tree_id, "tree")]
result["view"] = view_tree_id
return result
Expand Down
70 changes: 56 additions & 14 deletions custom_p/views/sale_order_line_view.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_sales_order_line_input_tree" model="ir.ui.view">
<record id="view_order_line_tree" model="ir.ui.view">
<field name="model">sale.order.line</field>
<field
name="inherit_id"
ref="sale_order_line_input.view_sales_order_line_input_tree"
/>
<field name="inherit_id" ref="sale.view_order_line_tree" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-warning">0</attribute>
<attribute name="editable">bottom</attribute>
</tree>
<field name="order_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<button name="action_sale_order_form" position="attributes">
<attribute name="attrs">{'invisible': [(1,'=',1)]}</attribute>
</button>
<!--<button name="action_sale_order_form" position="attributes">
<attribute name="invisible">1</attribute>
</button>-->
<field name="team_id" position="attributes">
<attribute name="optional">hide</attribute>
</field>
Expand All @@ -26,23 +24,67 @@
<field name="partner_shipping_id" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="product_id" position="after">
<field name="name" position="before">
<field name="product_id" />
<field name="company_id" invisible="1" />
<field name="product_uom_category_id" invisible="1" />
<field name="lot_id" />
<field name="allowed_lot_ids" invisible="1" />
</field>
<field name="name" position="after">
<field name="container" optional="hide" />
<field name="route_id" optional="hide" />
<field name="name" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="price_subtotal" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="container" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="entire_chick_percentage" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="route_id" position="attributes">
<attribute name="optional">hide</attribute>
</field>
<field name="product_packaging" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="product_packaging_qty" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="container" position="after">
<field name="palet_id" optional="show" />
<field name="palet_qty" optional="show" />
<field name="gross_weight" optional="hide" />
<field name="product_packaging" optional="show" />
<field name="product_packaging_qty" optional="show" />
</field>
<field name="qty_delivered" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="returned_amount" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="pending_qty" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="qty_invoiced" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="qty_to_invoice" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="salesman_id" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="product_uom_qty" position="after">
<field name="entire_chick_percentage" optional="hidde" />
<field name="entire_chick_percentage" position="after">
<field name="return_qty" optional="hide" />
</field>
<field name="product_uom" position="after">
<field name="surplus" optional="hide" />
<field name="price_unit" optional="hide" />
<field name="tax_id" widget="many2many_tags" optional="hide" />
<field name="discount" optional="hide" />
</field>
</field>
</record>
Expand Down

0 comments on commit 1dcc718

Please sign in to comment.