mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] contract_sale_generation: it doesn't create sales (#141)
* Change the method called in the view * Complete the create_invoice method * Bump version + authoring * Correct bad call of method Small Documentation * Add super call in python test * FIX bad field names causing bad quantities in sale.order.line
This commit is contained in:
committed by
Denis Roussel
parent
983165468e
commit
6fe52a364d
@@ -21,10 +21,11 @@ class AccountAnalyticAccount(models.Model):
|
||||
sale_line = self.env['sale.order.line'].new({
|
||||
'order_id': order_id,
|
||||
'product_id': line.product_id.id,
|
||||
'proudct_uom_qty': line.quantity,
|
||||
'proudct_uom_id': line.uom_id.id,
|
||||
'product_qty': line.quantity,
|
||||
'product_uom_qty': line.quantity,
|
||||
'product_uom': line.uom_id.id,
|
||||
})
|
||||
# Get other invoice line values from product onchange
|
||||
# Get other sale line values from product onchange
|
||||
sale_line.product_id_change()
|
||||
sale_line_vals = sale_line._convert_to_write(sale_line._cache)
|
||||
# Insert markers
|
||||
@@ -66,6 +67,11 @@ class AccountAnalyticAccount(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _create_invoice(self):
|
||||
"""
|
||||
Create invoices
|
||||
@param self: single record of account.invoice
|
||||
@return: MUST return an invoice recordset
|
||||
"""
|
||||
self.ensure_one()
|
||||
if self.type == 'invoice':
|
||||
return super(AccountAnalyticAccount, self)._create_invoice()
|
||||
@@ -74,6 +80,11 @@ class AccountAnalyticAccount(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _create_sale(self):
|
||||
"""
|
||||
Create Sale orders
|
||||
@param self: single record of sale.order
|
||||
@return: MUST return a sale.order recordset
|
||||
"""
|
||||
self.ensure_one()
|
||||
if self.type == 'sale':
|
||||
sale_vals = self._prepare_sale()
|
||||
|
||||
Reference in New Issue
Block a user