Skip to content

Commit

Permalink
[MIG] account_move_line_stock_info to v10
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Mar 16, 2017
1 parent eb863f6 commit 11eff9f
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 71 deletions.
5 changes: 2 additions & 3 deletions account_move_line_stock_info/README.rst
Expand Up @@ -8,7 +8,6 @@ Account Move Line Stock Move

This module adds the stock move to the account move lines that it generates.


Usage
=====

Expand All @@ -21,8 +20,7 @@ Reports > Stock moves'.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/153/8.0

:target: https://runbot.odoo-community.org/runbot/153/10.0

Bug Tracker
===========
Expand All @@ -40,6 +38,7 @@ Credits
Contributors
------------
* Jordi Ballester Alomar <jordi.ballester@eficent.com>
* Lois Rilo <lois.rilo@eficent.com>

Maintainer
----------
Expand Down
2 changes: 1 addition & 1 deletion account_move_line_stock_info/__openerp__.py
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Move Line Stock Move",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"depends": [
"stock_account"
],
Expand Down
1 change: 0 additions & 1 deletion account_move_line_stock_info/models/__init__.py
Expand Up @@ -3,5 +3,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import account_move_line
from . import stock_quant
from . import stock_move
2 changes: 1 addition & 1 deletion account_move_line_stock_info/models/account_move_line.py
Expand Up @@ -2,7 +2,7 @@
# © 2016 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import fields, models
from odoo import fields, models


class AccountMoveLine(models.Model):
Expand Down
11 changes: 10 additions & 1 deletion account_move_line_stock_info/models/stock_move.py
Expand Up @@ -2,7 +2,7 @@
# © 2016 Eficent Business and IT Consulting Services S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import fields, models
from odoo import api, fields, models


class StockMove(models.Model):
Expand All @@ -11,3 +11,12 @@ class StockMove(models.Model):
account_move_line_ids = fields.One2many(
comodel_name='account.move.line', inverse_name='stock_move_id',
copy=False)

@api.model
def _prepare_account_move_line(self, qty, cost,
credit_account_id, debit_account_id):
res = super(StockMove, self)._prepare_account_move_line(
qty, cost, credit_account_id, debit_account_id)
for line in res:
line[2]['stock_move_id'] = self.id
return res
18 changes: 0 additions & 18 deletions account_move_line_stock_info/models/stock_quant.py

This file was deleted.

Expand Up @@ -2,10 +2,10 @@
# © 2015 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 openerp.tests import common
from odoo.tests.common import TransactionCase


class TestAccountMoveLineStockInfo(common.TransactionCase):
class TestAccountMoveLineStockInfo(TransactionCase):

def setUp(self):
super(TestAccountMoveLineStockInfo, self).setUp()
Expand Down
36 changes: 18 additions & 18 deletions account_move_line_stock_info/views/account_move_line_view.xml
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account.move.line.form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form"/>
<field name="arch" type="xml">
<field name="quantity" position="before">
<field name="stock_move_id"/>
</field>
<record id="view_move_line_form" model="ir.ui.view">
<field name="name">account.move.line.form</field>
<field name="model">account.move.line</field>
<field name="inherit_id" ref="account.view_move_line_form"/>
<field name="arch" type="xml">
<field name="quantity" position="before">
<field name="stock_move_id"/>
</field>
</record>
</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="stock_move_id"/>
</field>
<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="stock_move_id"/>
</field>
</record>
</field>
</record>

</odoo>
52 changes: 26 additions & 26 deletions account_move_line_stock_info/views/stock_move_view.xml
@@ -1,35 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="view_move_form" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form"/>
<field name="arch" type="xml">
<group name="moved_quants_grp" position="after">
<group name="account_move_lines_grp"
string="Journal Items" colspan="4">
<field name="account_move_line_ids" readonly="1"
nolabel="1"/>
</group>
<record id="view_move_form" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form"/>
<field name="arch" type="xml">
<group name="moved_quants_grp" position="after">
<group name="account_move_lines_grp"
string="Journal Items" colspan="4">
<field name="account_move_line_ids" readonly="1"
nolabel="1"/>
</group>
</field>
</record>
</group>
</field>
</record>


<record id="view_move_picking_form" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_form"/>
<field name="arch" type="xml">
<group name="moved_quants_grp" position="after">
<group name="account_move_lines_grp"
string="Journal Items" colspan="4">
<field name="account_move_line_ids" readonly="1"
nolabel="1"/>
</group>
<record id="view_move_picking_form" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_form"/>
<field name="arch" type="xml">
<group name="moved_quants_grp" position="after">
<group name="account_move_lines_grp"
string="Journal Items" colspan="4">
<field name="account_move_line_ids" readonly="1"
nolabel="1"/>
</group>
</field>
</record>
</group>
</field>
</record>

</odoo>

0 comments on commit 11eff9f

Please sign in to comment.