Browse Source

[IMP] - get contract line default data onchange product_id

pull/265/head
sbejaoui 6 years ago
parent
commit
22b9d1cc00
  1. 6
      product_contract_variable_quantity/models/contract_line.py
  2. 6
      product_contract_variable_quantity/models/sale_order_line.py

6
product_contract_variable_quantity/models/contract_line.py

@ -9,8 +9,10 @@ class AccountAnalyticInvoiceLine(models.Model):
_inherit = 'account.analytic.invoice.line' _inherit = 'account.analytic.invoice.line'
@api.onchange('product_id') @api.onchange('product_id')
def onchange_product(self):
super(AccountAnalyticInvoiceLine, self).onchange_product()
def _onchange_product_id_recurring_info(self):
super(
AccountAnalyticInvoiceLine, self
)._onchange_product_id_recurring_info()
if self.product_id.is_contract: if self.product_id.is_contract:
self.qty_type = self.product_id.qty_type self.qty_type = self.product_id.qty_type
self.qty_formula_id = self.product_id.qty_formula_id self.qty_formula_id = self.product_id.qty_formula_id

6
product_contract_variable_quantity/models/sale_order_line.py

@ -32,9 +32,11 @@ class SaleOrderLine(models.Model):
rec.qty_formula_id = rec.product_id.qty_formula_id rec.qty_formula_id = rec.product_id.qty_formula_id
@api.multi @api.multi
def _prepare_contract_line_values(self, contract):
def _prepare_contract_line_values(
self, contract, predecessor_contract_line=False
):
values = super(SaleOrderLine, self)._prepare_contract_line_values( values = super(SaleOrderLine, self)._prepare_contract_line_values(
contract
contract, predecessor_contract_line
) )
values['qty_type'] = self.qty_type values['qty_type'] = self.qty_type
values['qty_formula_id'] = self.qty_formula_id.id values['qty_formula_id'] = self.qty_formula_id.id

Loading…
Cancel
Save