Skip to content

Commit e84d187

Browse files
Artem KostyukSodexisTeam
authored andcommitted
[12.0][MIG] sale_automatic_workflow: Migrate to 12.0
1 parent bcc91f2 commit e84d187

File tree

10 files changed

+71
-110
lines changed

10 files changed

+71
-110
lines changed

sale_automatic_workflow/README.rst

Lines changed: 0 additions & 83 deletions
This file was deleted.

sale_automatic_workflow/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
# Copyright 2011 Akretion Sébastien BEAU <[email protected]>
2-
# Copyright 2013 Camptocamp SA (author: Guewen Baconnier)
3-
# Copyright 2016 Sodexis
4-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5-
61
from . import models

sale_automatic_workflow/__manifest__.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55

66
{
77
'name': 'Sale Automatic Workflow',
8-
'version': '11.0.1.0.0',
8+
'version': '12.0.1.0.0',
99
'category': 'Sales Management',
1010
'license': 'AGPL-3',
11-
'author': "Akretion,Camptocamp,Sodexis,Odoo Community Association (OCA)",
11+
'author': "Akretion, "
12+
"Camptocamp, "
13+
"Sodexis, "
14+
"Odoo Community Association (OCA)",
1215
'website': 'https://github.com/OCA/sale-workflow',
13-
'depends': ['sale_stock',
14-
'sales_team',
15-
],
16-
'data': ['views/sale_view.xml',
17-
'views/sale_workflow_process_view.xml',
18-
'data/automatic_workflow_data.xml',
19-
'security/ir.model.access.csv',
20-
],
21-
'installable': True,
16+
'depends': [
17+
'sale_stock',
18+
'sales_team',
19+
],
20+
'data': [
21+
'security/ir.model.access.csv',
22+
'views/sale_view.xml',
23+
'views/sale_workflow_process_view.xml',
24+
'data/automatic_workflow_data.xml',
25+
],
2226
}

sale_automatic_workflow/models/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Copyright 2011 Akretion Sébastien BEAU <[email protected]>
2-
# Copyright 2013 Camptocamp SA (author: Guewen Baconnier)
3-
# Copyright 2016 Sodexis
4-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
5-
61
from . import automatic_workflow_job
72
from . import account_invoice
83
from . import sale_order

sale_automatic_workflow/models/automatic_workflow_job.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class AutomaticWorkflowJob(models.Model):
3939
invoices, pickings... """
4040

4141
_name = 'automatic.workflow.job'
42+
_description = (
43+
'Scheduler that will play automatically the validation of'
44+
' invoices, pickings...'
45+
)
4246

4347
@api.model
4448
def _validate_sale_orders(self, order_filter):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* Guewen Baconnier
2+
* Beau Sebastien
3+
* Leonardo Pistone
4+
* Stéphane Bidoul
5+
* Damien Crier
6+
* Alexandre Fayolle
7+
* Sodexis
8+
* Dave Lasley <[email protected]>
9+
* Akim Juillerat <[email protected]>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Create workflows with more or less automatization and apply it on sales
2+
orders.
3+
4+
A workflow can:
5+
6+
- Apply default values:
7+
8+
* Packing Policy (partial, complete)
9+
* Shipping Policy (prepaid, manual, postpaid, picking)
10+
* Invoice On (ordered quantities, shipped quantities)
11+
* Set the invoice's date to the sale order's date
12+
* Set a sales team
13+
14+
- Apply automatic actions:
15+
16+
* Validate the order (only if paid, always, never)
17+
* Create an invoice
18+
* Validate the invoice
19+
* Confirm the picking
20+
21+
This module is used by Magentoerpconnect and Prestashoperpconnect.
22+
It is well suited for other E-Commerce connectors as well.

sale_automatic_workflow/tests/test_automatic_workflow.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,19 @@ def test_date_invoice_from_sale_order(self):
6060

6161
def test_invoice_from_picking_with_service_product(self):
6262
workflow = self.create_full_automatic()
63-
product_service = self.env.ref('product.service_order_01')
64-
product_uom_hour = self.env.ref('product.product_uom_hour')
63+
product_service = self.env['product.product'].create({
64+
'name': 'Remodeling Service',
65+
'categ_id': self.env.ref('product.product_category_3').id,
66+
'standard_price': 40.0,
67+
'list_price': 90.0,
68+
'type': 'service',
69+
'uom_id': self.env.ref('uom.product_uom_hour').id,
70+
'uom_po_id': self.env.ref('uom.product_uom_hour').id,
71+
'description': 'Example of product to invoice on order',
72+
'default_code': 'PRE-PAID',
73+
'invoice_policy': 'order',
74+
})
75+
product_uom_hour = self.env.ref('uom.product_uom_hour')
6576
override = {
6677
'order_line': [(0, 0, {
6778
'name': 'Prepaid Consulting',

sale_automatic_workflow/tests/test_automatic_workflow_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def create_sale_order(self, workflow, override=None):
1414
'list_price': 5,
1515
'type': 'product'}
1616
product = self.env['product.product'].create(product_values)
17-
self.product_uom_unit = self.env.ref('product.product_uom_unit')
17+
self.product_uom_unit = self.env.ref('uom.product_uom_unit')
1818
values = {
1919
'partner_id': partner.id,
2020
'order_line': [(0, 0, {

sale_automatic_workflow/tests/test_multicompany.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,19 @@ def setUp(self):
134134
'company_id': self.company_be.id,
135135
'type': 'many2one',
136136
'fields_id': self.env.ref(
137-
'account.field_res_partner_property_account_receivable_id').id,
137+
'stock_account'
138+
'.field_account_chart_template__property_account_receivable_id'
139+
).id,
138140
'value': accounting_be['receivable']
139141
})
140142
self.env['ir.property'].create({
141143
'name': 'property_account_payable_id',
142144
'company_id': self.company_be.id,
143145
'type': 'many2one',
144146
'fields_id': self.env.ref(
145-
'account.field_res_partner_property_account_payable_id').id,
147+
'stock_account'
148+
'.field_account_chart_template__property_account_receivable_id'
149+
).id,
146150
'value': accounting_be['payable']
147151
})
148152
self.env['ir.property'].create({
@@ -174,7 +178,7 @@ def setUp(self):
174178
def create_auto_wkf_order(self, company, customer, product, qty):
175179
SaleOrder = self.env['sale.order']
176180

177-
self.product_uom_unit = self.env.ref('product.product_uom_unit')
181+
self.product_uom_unit = self.env.ref('uom.product_uom_unit')
178182

179183
order = SaleOrder.create({
180184
'partner_id': customer.id,

0 commit comments

Comments
 (0)