Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] purchase_procurement_analytic module: migration to 10.0
- Loading branch information
Showing
9 changed files
with
60 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
10 changes: 7 additions & 3 deletions
10
purchase_procurement_analytic/__openerp__.py → ...hase_procurement_analytic/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2017 Vicent Cubells <vicent.cubells@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
'name': 'Purchase Procurement Analytic', | ||
'summary': 'This module sets analytic account in purchase order line from ' | ||
'procurement analytic account', | ||
'version': '8.0.1.0.0', | ||
'version': '10.0.1.0.0', | ||
'category': 'Analytic', | ||
'license': 'AGPL-3', | ||
'author': "Tecnativa, " | ||
"Odoo Community Association (OCA)", | ||
'website': 'http://www.tecnativa.com', | ||
'depends': ['purchase', 'procurement_analytic'], | ||
'depends': [ | ||
'purchase', | ||
'procurement_analytic', | ||
], | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import procurement | ||
from . import purchase | ||
from . import stock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import api, models | ||
from odoo import api, models | ||
|
||
|
||
class ProcurementOrder(models.Model): | ||
_inherit = 'procurement.order' | ||
|
||
@api.model | ||
def _get_po_line_values_from_proc( | ||
self, procurement, partner, company, schedule_date): | ||
res = super(ProcurementOrder, self)._get_po_line_values_from_proc( | ||
procurement, partner, company, schedule_date) | ||
res['account_analytic_id'] = procurement.account_analytic_id.id | ||
def _prepare_purchase_order_line(self, po, supplier): | ||
res = super(ProcurementOrder, self)._prepare_purchase_order_line( | ||
po, supplier) | ||
res['account_analytic_id'] = self.account_analytic_id.id | ||
return res | ||
|
||
@api.multi | ||
def make_po(self): | ||
# This is a trick to avoid the grouping without this key. | ||
obj = self.with_context( | ||
account_analytic_id=self.account_analytic_id.id) | ||
limit_procurement_account_analytic_id=self.account_analytic_id.id) | ||
return super(ProcurementOrder, obj).make_po() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models | ||
from odoo import models | ||
|
||
|
||
class PurchaseOrderLine(models.Model): | ||
_inherit = 'purchase.order.line' | ||
|
||
def search(self, cr, uid, args, offset=0, limit=None, order=None, | ||
context=None, count=False): | ||
if 'account_analytic_id' in context and ( | ||
{'order_id', 'product_id', 'product_uom'} <= | ||
set(x[0] for x in args)): | ||
args.insert(0, ( | ||
'account_analytic_id', '=', context['account_analytic_id'])) | ||
def search(self, args, offset=0, limit=None, order=None, count=False): | ||
if 'limit_procurement_account_analytic_id' in self.env.context: | ||
args.insert(0, ('account_analytic_id', '=', self.env.context.get( | ||
'limit_procurement_account_analytic_id'))) | ||
return super(PurchaseOrderLine, self).search( | ||
cr, uid, args, offset=offset, limit=limit, order=order, | ||
context=context, count=count) | ||
args, offset=offset, limit=limit, order=order, count=count) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_purchase_procurement_analytic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters