mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
Use strings on fields compute to allow inheritance
This commit is contained in:
committed by
ahenriquez
parent
dfd409fa3e
commit
83e55d3281
@@ -58,7 +58,7 @@ class AccountInvoice(models.Model):
|
||||
return {}
|
||||
|
||||
rma_count = fields.Integer(
|
||||
compute=_compute_rma_count, string='# of RMA')
|
||||
compute='_compute_rma_count', string='# of RMA')
|
||||
|
||||
add_rma_line_id = fields.Many2one(
|
||||
comodel_name='rma.order.line',
|
||||
@@ -156,7 +156,7 @@ class AccountInvoiceLine(models.Model):
|
||||
invl.rma_line_count = len(rma_lines)
|
||||
|
||||
rma_line_count = fields.Integer(
|
||||
compute=_compute_rma_count, string='# of RMA')
|
||||
compute='_compute_rma_count', string='# of RMA')
|
||||
rma_line_ids = fields.One2many(
|
||||
comodel_name='rma.order.line', inverse_name='invoice_line_id',
|
||||
string="RMA", readonly=True,
|
||||
|
||||
@@ -25,9 +25,9 @@ class RmaOrder(models.Model):
|
||||
ondelete='set null', readonly=True,
|
||||
)
|
||||
invoice_refund_count = fields.Integer(
|
||||
compute=_compute_invoice_refund_count, string='# of Refunds')
|
||||
compute='_compute_invoice_refund_count', string='# of Refunds')
|
||||
invoice_count = fields.Integer(
|
||||
compute=_compute_invoice_count, string='# of Invoices')
|
||||
compute='_compute_invoice_count', string='# of Invoices')
|
||||
|
||||
def _prepare_rma_line_from_inv_line(self, line):
|
||||
if self.type == 'customer':
|
||||
|
||||
@@ -48,7 +48,7 @@ class RmaOrderLine(models.Model):
|
||||
help="Invoice address for current rma order.",
|
||||
)
|
||||
refund_count = fields.Integer(
|
||||
compute=_compute_refund_count, string='# of Refunds', default=0)
|
||||
compute='_compute_refund_count', string='# of Refunds', default=0)
|
||||
invoice_line_id = fields.Many2one(
|
||||
comodel_name='account.invoice.line',
|
||||
string='Originating Invoice Line',
|
||||
@@ -73,11 +73,11 @@ class RmaOrderLine(models.Model):
|
||||
qty_to_refund = fields.Float(
|
||||
string='Qty To Refund', copy=False,
|
||||
digits=dp.get_precision('Product Unit of Measure'), readonly=True,
|
||||
compute=_compute_qty_to_refund, store=True)
|
||||
compute='_compute_qty_to_refund', store=True)
|
||||
qty_refunded = fields.Float(
|
||||
string='Qty Refunded', copy=False,
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user