[MIG] account_move_line_stock_info: Migration to 17.0

* Minor adjustments
* Attrs substitution
* Readme update
* Add the journal items to the simlified operations form view

Co-authored-by: stefan@opener.amsterdam
This commit is contained in:
Carlos Vallés Fuster
2024-09-23 10:38:48 +02:00
committed by JasminSForgeFlow
parent 10124db5b9
commit ff32e7ebc1
8 changed files with 87 additions and 46 deletions

View File

@@ -39,12 +39,17 @@ generates.
Usage
=====
- The stock manager can check the journal items by accessing to
'Inventory > Reports > Stock moves'.
- A user belonging to the group 'Show Full Accounting Features' can
review the details of a move that is associated to a journal item
through 'Invoicing > Accounting > Journal Entries (or Journal
items)'.
- A user that has access to the inventory app plus at least readonly
access to the accounting features can view the stock move of each
journal item or journal entry as a column of the journal item tree
view. It is hidden by default. The field is also visible on the
journal item form view.
- Similarly, a user that has access to both the accounting app and the
inventory app can inspect the journal items related to a stock move
by clicking on the operations of a validated transfer. This will open
the simplified form view of the stock move. If there are any related
(valuation) journal items, they will be visible under the operation
detail lines.
Bug Tracker
===========

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Move Line Stock Info",
"version": "16.0.1.1.1",
"version": "17.0.1.0.0",
"depends": ["stock_account"],
"author": "ForgeFlow," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",

View File

@@ -17,7 +17,7 @@ class StockMove(models.Model):
def _prepare_account_move_line(
self, qty, cost, credit_account_id, debit_account_id, svl_id, description
):
res = super(StockMove, self)._prepare_account_move_line(
res = super()._prepare_account_move_line(
qty, cost, credit_account_id, debit_account_id, svl_id, description
)
for line in res:

View File

@@ -1,6 +1,9 @@
- The stock manager can check the journal items by accessing to
'Inventory \> Reports \> Stock moves'.
- A user belonging to the group 'Show Full Accounting Features' can
review the details of a move that is associated to a journal item
through 'Invoicing \> Accounting \> Journal Entries (or Journal
items)'.
- A user that has access to the inventory app plus at least readonly access to
the accounting features can view the stock move of each journal item or
journal entry as a column of the journal item tree view. It is hidden by
default. The field is also visible on the journal item form view.
- Similarly, a user that has access to both the accounting app and the inventory
app can inspect the journal items related to a stock move by clicking on the
operations of a validated transfer. This will open the simplified form view
of the stock move. If there are any related (valuation) journal items, they
will be visible under the operation detail lines.

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@@ -9,10 +8,11 @@
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@@ -388,12 +388,17 @@ generates.</p>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<ul class="simple">
<li>The stock manager can check the journal items by accessing to
Inventory &gt; Reports &gt; Stock moves.</li>
<li>A user belonging to the group Show Full Accounting Features can
review the details of a move that is associated to a journal item
through Invoicing &gt; Accounting &gt; Journal Entries (or Journal
items).</li>
<li>A user that has access to the inventory app plus at least readonly
access to the accounting features can view the stock move of each
journal item or journal entry as a column of the journal item tree
view. It is hidden by default. The field is also visible on the
journal item form view.</li>
<li>Similarly, a user that has access to both the accounting app and the
inventory app can inspect the journal items related to a stock move
by clicking on the operations of a validated transfer. This will open
the simplified form view of the stock move. If there are any related
(valuation) journal items, they will be visible under the operation
detail lines.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
@@ -428,7 +433,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>

View File

@@ -6,7 +6,7 @@ from odoo.tests.common import TransactionCase
class TestAccountMoveLineStockInfo(TransactionCase):
def setUp(self):
super(TestAccountMoveLineStockInfo, self).setUp()
super().setUp()
self.product_model = self.env["product.product"]
self.product_ctg_model = self.env["product.category"]
self.account_model = self.env["account.account"]
@@ -140,7 +140,8 @@ class TestAccountMoveLineStockInfo(TransactionCase):
self.picking_type_in, self.location_supplier, self.location_stock
)
picking_in.action_confirm()
picking_in.move_ids.quantity_done = 1
picking_in.move_ids.quantity = 1
picking_in.move_ids.picked = True
picking_in._action_done()
account_move_line = False
@@ -153,7 +154,8 @@ class TestAccountMoveLineStockInfo(TransactionCase):
self.picking_type_out, self.location_supplier, self.location_stock
)
picking_out.action_confirm()
picking_out.move_ids.quantity_done = 1
picking_out.move_ids.quantity = 1
picking_out.move_ids.picked = True
picking_out._action_done()
for move in picking_out.move_ids:

View File

@@ -24,5 +24,17 @@
</field>
</field>
</record>
<record id="view_account_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='line_ids']/tree" position="inside">
<field
name="stock_move_id"
groups="stock.group_stock_user"
optional="hide"
/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -6,22 +6,12 @@
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<group name="linked_group" position="after">
<group name="account_move_lines_grp" string="Journal Items" colspan="4">
<field name="account_move_line_ids" readonly="1" nolabel="1" />
</group>
</group>
</field>
</record>
<record id="view_picking_form" model="ir.ui.view">
<field name="name">stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<xpath
expr="//notebook//form//field[@name='description_picking']/.."
position="after"
>
<group name="account_move_lines_grp" string="Journal Items">
<group
name="account_move_lines_grp"
colspan="4"
groups="account.group_account_readonly"
string="Journal Items"
>
<field
name="account_move_line_ids"
readonly="1"
@@ -29,7 +19,29 @@
colspan="2"
/>
</group>
</xpath>
</group>
</field>
</record>
<record id="view_stock_move_operations" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_stock_move_operations" />
<field name="arch" type="xml">
<field name="move_line_ids" position="after">
<group
name="journal_items"
groups="account.group_account_readonly"
invisible="not account_move_line_ids"
string="Journal Items"
>
<field
name="account_move_line_ids"
readonly="1"
nolabel="1"
colspan="2"
/>
</group>
</field>
</field>
</record>
</odoo>