mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] rma, rma_sale: added select all, messages for UX
This commit is contained in:
committed by
JasminSForgeFlow
parent
c33658fe5c
commit
5321dc6e30
@@ -68,6 +68,22 @@ class RmaAddSale(models.TransientModel):
|
|||||||
comodel_name="stock.production.lot", string="Lots/Serials selected"
|
comodel_name="stock.production.lot", string="Lots/Serials selected"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def select_all(self):
|
||||||
|
self.ensure_one()
|
||||||
|
self.write(
|
||||||
|
{
|
||||||
|
"lot_ids": [(6, 0, self.lot_domain_ids.ids)],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
"type": "ir.actions.act_window",
|
||||||
|
"name": _("Add Sale Order"),
|
||||||
|
"view_mode": "form",
|
||||||
|
"res_model": self._name,
|
||||||
|
"res_id": self.id,
|
||||||
|
"target": "new",
|
||||||
|
}
|
||||||
|
|
||||||
def _prepare_rma_line_from_sale_order_line(self, line, lot=None):
|
def _prepare_rma_line_from_sale_order_line(self, line, lot=None):
|
||||||
operation = line.product_id.rma_customer_operation_id
|
operation = line.product_id.rma_customer_operation_id
|
||||||
if not operation:
|
if not operation:
|
||||||
|
|||||||
@@ -44,18 +44,33 @@
|
|||||||
</field>
|
</field>
|
||||||
<field name="show_lot_filter" invisible="1" />
|
<field name="show_lot_filter" invisible="1" />
|
||||||
<field name="lot_domain_ids" widget="many2many_tags" invisible="1" />
|
<field name="lot_domain_ids" widget="many2many_tags" invisible="1" />
|
||||||
|
<div
|
||||||
|
class="oe_grey"
|
||||||
|
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||||
|
>
|
||||||
|
The creation of the RMA Lines will be separated according to the lots or serials selected
|
||||||
|
</div>
|
||||||
|
<div class="o_row">
|
||||||
<label
|
<label
|
||||||
for="lot_ids"
|
for="lot_ids"
|
||||||
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||||
string="Create rma with lot/serials selected"
|
string="Selected Lot/Serial Numbers"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="lot_ids"
|
name="lot_ids"
|
||||||
widget="many2many_tags"
|
widget="many2many_tags"
|
||||||
domain="[('id', 'in', lot_domain_ids)]"
|
domain="[('id', 'in', lot_domain_ids)]"
|
||||||
attrs="{'invisible': [('show_lot_filter', '=', False)], 'required': [('show_lot_filter', '=', True)]}"
|
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||||
options="{'no_create': True}"
|
options="{'no_create': True}"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
name="select_all"
|
||||||
|
type="object"
|
||||||
|
string="Select all"
|
||||||
|
class="oe_inline"
|
||||||
|
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
<button
|
<button
|
||||||
string="Confirm"
|
string="Confirm"
|
||||||
|
|||||||
Reference in New Issue
Block a user