diff --git a/contract_sale_generation/README.rst b/contract_sale_generation/README.rst index dda5002294..e7ccfec97c 100644 --- a/contract_sale_generation/README.rst +++ b/contract_sale_generation/README.rst @@ -40,6 +40,7 @@ Contributors ------------ * Angel Moya +* Florent THOMAS Maintainer ---------- diff --git a/contract_sale_generation/__manifest__.py b/contract_sale_generation/__manifest__.py index 285b301342..f20c1a7aa9 100644 --- a/contract_sale_generation/__manifest__.py +++ b/contract_sale_generation/__manifest__.py @@ -6,7 +6,7 @@ { 'name': 'Contracts Management - Recurring Sales', - 'version': '10.0.2.0.0', + 'version': '10.0.3.0.0', 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "PESOL, " diff --git a/contract_sale_generation/models/account_analytic_account.py b/contract_sale_generation/models/account_analytic_account.py index 1079d3b8e9..c07d6b0d92 100644 --- a/contract_sale_generation/models/account_analytic_account.py +++ b/contract_sale_generation/models/account_analytic_account.py @@ -21,10 +21,11 @@ def _prepare_sale_line(self, line, order_id): 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 @@ def _prepare_sale(self): @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 @@ def _create_invoice(self): @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() diff --git a/contract_sale_generation/views/account_analytic_account_view.xml b/contract_sale_generation/views/account_analytic_account_view.xml index 9157863392..47a4ccec85 100644 --- a/contract_sale_generation/views/account_analytic_account_view.xml +++ b/contract_sale_generation/views/account_analytic_account_view.xml @@ -14,7 +14,7 @@ {'invisible': ['|',('recurring_invoices','!=',True),('type','!=','invoice')]} -