2
0

[11.0][MIG] account_move_line_purchase_info

This commit is contained in:
Lois Rilo 2018-02-09 14:30:59 +01:00 committed by Andrea Stirpe
parent 342d10d336
commit 315cddebf1
11 changed files with 22 additions and 38 deletions

View File

@ -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
===========

View File

@ -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

View File

@ -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",

View File

@ -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

View File

@ -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

View File

@ -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,
)

View File

@ -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

View File

@ -3,7 +3,7 @@
<record id="group_account_move_purchase_info" model="res.groups">
<field name="name">Purchase info in Journal Items</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="category_id" ref="base.module_category_hidden"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
</record>

View File

@ -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

View File

@ -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:

View File

@ -13,18 +13,6 @@
</field>
</record>
<record id="view_move_line_form2" model="ir.ui.view">
<field name="name">account.move.line.form2</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form2"/>
<field name="arch" type="xml">
<field name="quantity" position="before">
<field name="purchase_line_id"
groups="account_move_line_purchase_info.group_account_move_purchase_info"/>
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">account.move.line.tree</field>
<field name="model">account.move.line</field>