Skip to content

Commit

Permalink
delivery_roulier_picking_batch: add partner on stock_picking_batch, a…
Browse files Browse the repository at this point in the history
…nd improve view
  • Loading branch information
sebastienbeau committed Nov 28, 2024
1 parent a3d505c commit 0240730
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
8 changes: 5 additions & 3 deletions delivery_roulier_picking_batch/models/stock_picking_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ def _get_default_weight_uom(self):
"delivery.carrier", string="Carrier", check_company=True
)
partner_id = fields.Many2one(
"res.partner", string="Delivery Address", check_company=True,
)
"res.partner",
string="Delivery Address",
check_company=True,
)
weight = fields.Float(
compute="_compute_weight",
digits="Stock Weight",
Expand Down Expand Up @@ -52,7 +54,7 @@ def _compute_allowed_picking_ids(self):
if record.partner_id:
record.allowed_picking_ids = record.allowed_picking_ids.filtered(
lambda s: s.partner_id == record.partner_id
)
)

@api.constrains("carrier_id")
def _check_carrier_id_is_roulier(self):
Expand Down
22 changes: 16 additions & 6 deletions delivery_roulier_picking_batch/views/stock_picking_batch_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<field name="inherit_id" ref="stock_picking_batch.stock_picking_batch_tree" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="partner_id"/>
<field name="carrier_id"/>
<field name="partner_id" />
<field name="carrier_id" />
</field>
</field>
</record>
Expand All @@ -21,12 +21,22 @@
<field name="inherit_id" ref="stock_picking_batch.stock_picking_batch_filter" />
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="partner_id"/>
<field name="carrier_id"/>
<field name="partner_id" />
<field name="carrier_id" />
</field>
<filter name="user" position="after">
<filter string="Partner" name="partner" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Carrier" name="carrier" domain="[]" context="{'group_by': 'carrier_id'}"/>
<filter
string="Partner"
name="partner"
domain="[]"
context="{'group_by': 'partner_id'}"
/>
<filter
string="Carrier"
name="carrier"
domain="[]"
context="{'group_by': 'carrier_id'}"
/>
</filter>
</field>
</record>
Expand Down

0 comments on commit 0240730

Please sign in to comment.