Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][FIX] Sale generation doesn't create sales #141

Merged
merged 8 commits into from
Apr 1, 2018
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contract_sale_generation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Contributors
------------

* Angel Moya <angel.moya@pesol.es>
* Florent THOMAS <florent.thomas@mind-and-go.com>

Maintainer
----------
Expand Down
2 changes: 1 addition & 1 deletion contract_sale_generation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
10 changes: 10 additions & 0 deletions contract_sale_generation/models/account_analytic_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def _prepare_sale(self):

@api.multi
def _create_invoice(self):
"""
Create invoices
@param None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be @param self: Single record of type x

@return: MUST return an invoice recordset
"""
self.ensure_one()
if self.type == 'invoice':
return super(AccountAnalyticAccount, self)._create_invoice()
Expand All @@ -74,6 +79,11 @@ def _create_invoice(self):

@api.multi
def _create_sale(self):
"""
Create Sale orders
@param None
@return: MUST return a sale.order recordset
"""
self.ensure_one()
if self.type == 'sale':
sale_vals = self._prepare_sale()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<attribute name="attrs">{'invisible': ['|',('recurring_invoices','!=',True),('type','!=','invoice')]}</attribute>
</xpath>
<xpath expr="//button[@name='recurring_create_invoice']" position="before">
<button name="recurring_create_invoice"
<button name="recurring_create_sale"
type="object"
attrs="{'invisible': ['|',('recurring_invoices','!=',True),('type','!=','sale')]}"
string="Create sales"
Expand Down
1 change: 1 addition & 0 deletions product_contract/tests/test_sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def tearDown(self):
self.env['account.analytic.account']._revert_method(
'create',
)
super(TestSaleOrder, self).tearDown()

def test_action_done(self):
""" It should create a contract when the sale for a contract is set
Expand Down