From 315cddebf16c015a4fc6f64c6113a561080946ac Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Fri, 9 Feb 2018 14:30:59 +0100 Subject: [PATCH] [11.0][MIG] account_move_line_purchase_info --- account_move_line_purchase_info/README.rst | 2 +- account_move_line_purchase_info/__init__.py | 2 -- account_move_line_purchase_info/__manifest__.py | 8 ++++---- account_move_line_purchase_info/models/__init__.py | 2 -- .../models/account_invoice.py | 4 ++-- .../models/account_move.py | 12 +++++++----- account_move_line_purchase_info/models/stock_move.py | 4 ++-- .../security/account_security.xml | 2 +- account_move_line_purchase_info/tests/__init__.py | 2 -- .../tests/test_account_move_line_purchase_info.py | 10 +++++----- .../views/account_move_view.xml | 12 ------------ 11 files changed, 22 insertions(+), 38 deletions(-) diff --git a/account_move_line_purchase_info/README.rst b/account_move_line_purchase_info/README.rst index db4fd240..bb7a0ba8 100644 --- a/account_move_line_purchase_info/README.rst +++ b/account_move_line_purchase_info/README.rst @@ -25,7 +25,7 @@ The purchase order line will be automatically copied to the journal items. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/92/9.0 + :target: https://runbot.odoo-community.org/runbot/92/11.0 Bug Tracker =========== diff --git a/account_move_line_purchase_info/__init__.py b/account_move_line_purchase_info/__init__.py index b33ed7e3..4b76c7b2 100644 --- a/account_move_line_purchase_info/__init__.py +++ b/account_move_line_purchase_info/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import models diff --git a/account_move_line_purchase_info/__manifest__.py b/account_move_line_purchase_info/__manifest__.py index 4b5ac4f4..65dc1c67 100644 --- a/account_move_line_purchase_info/__manifest__.py +++ b/account_move_line_purchase_info/__manifest__.py @@ -1,16 +1,16 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Account Move Line Purchase Info", "summary": "Introduces the purchase order line to the journal items", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "author": "Eficent, " "Odoo Community Association (OCA)", "website": "http://www.github.com/OCA/account-financial-tools", "category": "Generic", - "depends": ["account_accountant", "purchase"], + "depends": ["account", "purchase"], "license": "AGPL-3", "data": [ "security/account_security.xml", diff --git a/account_move_line_purchase_info/models/__init__.py b/account_move_line_purchase_info/models/__init__.py index ce392315..078b9f61 100644 --- a/account_move_line_purchase_info/models/__init__.py +++ b/account_move_line_purchase_info/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import account_move diff --git a/account_move_line_purchase_info/models/account_invoice.py b/account_move_line_purchase_info/models/account_invoice.py index 5bee211e..c1f842c6 100644 --- a/account_move_line_purchase_info/models/account_invoice.py +++ b/account_move_line_purchase_info/models/account_invoice.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models diff --git a/account_move_line_purchase_info/models/account_move.py b/account_move_line_purchase_info/models/account_move.py index 784bc895..ae13253b 100644 --- a/account_move_line_purchase_info/models/account_move.py +++ b/account_move_line_purchase_info/models/account_move.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import fields, models @@ -9,6 +9,8 @@ class AccountMoveLine(models.Model): _inherit = 'account.move.line' - purchase_line_id = fields.Many2one('purchase.order.line', - 'Purchase Order Line', - ondelete='set null', index=True) + purchase_line_id = fields.Many2one( + comodel_name='purchase.order.line', + string='Purchase Order Line', + ondelete='set null', index=True, + ) diff --git a/account_move_line_purchase_info/models/stock_move.py b/account_move_line_purchase_info/models/stock_move.py index ca5f8ad9..c9047910 100644 --- a/account_move_line_purchase_info/models/stock_move.py +++ b/account_move_line_purchase_info/models/stock_move.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models diff --git a/account_move_line_purchase_info/security/account_security.xml b/account_move_line_purchase_info/security/account_security.xml index 6362d1be..8e5894f8 100644 --- a/account_move_line_purchase_info/security/account_security.xml +++ b/account_move_line_purchase_info/security/account_security.xml @@ -3,7 +3,7 @@ Purchase info in Journal Items - + diff --git a/account_move_line_purchase_info/tests/__init__.py b/account_move_line_purchase_info/tests/__init__.py index 6e62a244..50df52a3 100644 --- a/account_move_line_purchase_info/tests/__init__.py +++ b/account_move_line_purchase_info/tests/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent - Jordi Ballester Alomar # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from . import test_account_move_line_purchase_info diff --git a/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py b/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py index d571a855..7cb5e83b 100644 --- a/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py +++ b/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. (www.eficent.com) +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# (www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests import common @@ -178,8 +178,8 @@ class TestAccountMoveLinePurchaseInfo(common.TransactionCase): purchase.button_confirm() picking = purchase.picking_ids[0] picking.force_assign() - picking.pack_operation_product_ids.write({'qty_done': 1.0}) - picking.do_new_transfer() + picking.move_lines.write({'quantity_done': 1.0}) + picking.button_validate() expected_balance = 1.0 self._check_account_balance(self.account_inventory.id, @@ -192,7 +192,7 @@ class TestAccountMoveLinePurchaseInfo(common.TransactionCase): 'account_id': purchase.partner_id.property_account_payable_id.id, }) invoice.purchase_order_change() - invoice.signal_workflow('invoice_open') + invoice.action_invoice_open() for aml in invoice.move_id.line_ids: if aml.product_id == po_line.product_id and aml.invoice_id: diff --git a/account_move_line_purchase_info/views/account_move_view.xml b/account_move_line_purchase_info/views/account_move_view.xml index 6f185bc1..49547e4f 100644 --- a/account_move_line_purchase_info/views/account_move_view.xml +++ b/account_move_line_purchase_info/views/account_move_view.xml @@ -13,18 +13,6 @@ - - account.move.line.form2 - account.move.line - - - - - - - - account.move.line.tree account.move.line