mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[9.0][IMP] rma_sale and rma_account: consider product when filtering sources on rma lines
This commit is contained in:
@@ -79,6 +79,21 @@ class RmaOrderLine(models.Model):
|
|||||||
digits=dp.get_precision('Product Unit of Measure'),
|
digits=dp.get_precision('Product Unit of Measure'),
|
||||||
readonly=True, compute=_compute_qty_refunded, store=True)
|
readonly=True, compute=_compute_qty_refunded, store=True)
|
||||||
|
|
||||||
|
@api.onchange('product_id')
|
||||||
|
def _onchange_product_id(self):
|
||||||
|
res = super(RmaOrderLine, self)._onchange_product_id()
|
||||||
|
if res.get('domain') and self.product_id:
|
||||||
|
res['domain']['invoice_line_id'] = [
|
||||||
|
('product_id', '=', self.product_id.id)]
|
||||||
|
elif res.get('domain') and self.product_id:
|
||||||
|
res['domain']['invoice_line_id'] = [()]
|
||||||
|
elif not res.get('domain') and self.product_id:
|
||||||
|
res['domain'] = {
|
||||||
|
'invoice_line_id': [('product_id', '=', self.product_id.id)]}
|
||||||
|
else:
|
||||||
|
res['domain'] = {'invoice_line_id': []}
|
||||||
|
return res
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _prepare_rma_line_from_inv_line(self, line):
|
def _prepare_rma_line_from_inv_line(self, line):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
|
|||||||
Reference in New Issue
Block a user