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

[14.0][IMP] custom_p: Add lines in bottom of sale line tree view. #3053

Merged
merged 2 commits into from
Dec 18, 2024
Merged
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
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
71 changes: 57 additions & 14 deletions custom_p/views/sale_order_line_view.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<?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>
<attribute name="create" />
</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 +25,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
Loading