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"
|
||||
)
|
||||
|
||||
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):
|
||||
operation = line.product_id.rma_customer_operation_id
|
||||
if not operation:
|
||||
|
||||
@@ -44,18 +44,33 @@
|
||||
</field>
|
||||
<field name="show_lot_filter" 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
|
||||
for="lot_ids"
|
||||
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||
string="Create rma with lot/serials selected"
|
||||
string="Selected Lot/Serial Numbers"
|
||||
/>
|
||||
<field
|
||||
name="lot_ids"
|
||||
widget="many2many_tags"
|
||||
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}"
|
||||
/>
|
||||
<button
|
||||
name="select_all"
|
||||
type="object"
|
||||
string="Select all"
|
||||
class="oe_inline"
|
||||
attrs="{'invisible': [('show_lot_filter', '=', False)]}"
|
||||
/>
|
||||
</div>
|
||||
<footer>
|
||||
<button
|
||||
string="Confirm"
|
||||
|
||||
Reference in New Issue
Block a user