Skip to content

Commit

Permalink
[MIG] stock_picking_analytic: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Aug 7, 2024
1 parent 16746ae commit c73fd2f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 26 deletions.
4 changes: 4 additions & 0 deletions stock_picking_analytic/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Contributors

- Yoshi Tashiro

- `APSL-Nagarro <https://apsl.tech>`__:

- Antoni Marroig <[email protected]>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion stock_picking_analytic/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Stock Picking Analytic",
"summary": """
Allows to define the analytic account on picking level""",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-analytic",
Expand Down
14 changes: 1 addition & 13 deletions stock_picking_analytic/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ class StockPicking(models.Model):
help="Technical field. Use to store the value of"
"analytic_distribution if there is no lines",
)
analytic_distribution = fields.Json(
inverse="_inverse_analytic_distribution",
states={
"done": [("readonly", True)],
"cancel": [("readonly", True)],
},
)
# Assign a dummy search arg to the field to avoid triggering the warning.
# Without this, use of move_ids_without_package in @api.depends() of the compute
# method would trigger a warning from
# https://github.com/odoo/odoo/blob/0f84366/odoo/fields.py#L808-L812
# pylint: disable=method-search
move_ids_without_package = fields.One2many(search="[]")
analytic_distribution = fields.Json(inverse="_inverse_analytic_distribution")

@api.depends(
"move_ids_without_package.analytic_distribution",
Expand Down
2 changes: 2 additions & 0 deletions stock_picking_analytic/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
- Denis Roussel \<<[email protected]>\>
- [Quartile](https://www.quartile.co):
- Yoshi Tashiro
- [APSL-Nagarro](<https://apsl.tech>):
- Antoni Marroig \<<[email protected]>\>
4 changes: 4 additions & 0 deletions stock_picking_analytic/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,10 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<li>Yoshi Tashiro</li>
</ul>
</li>
<li><a class="reference external" href="https://apsl.tech">APSL-Nagarro</a>:<ul>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def setUpClass(cls):
super().setUpClass()
cls.product_id = cls.env.ref("product.product_product_9")
cls.uom_id = cls.env.ref("uom.product_uom_unit")
analytic_plan = cls.env["account.analytic.plan"].create(
{"name": "Plan Test", "company_id": False}
)
analytic_plan = cls.env["account.analytic.plan"].create({"name": "Plan Test"})
analytic_account = cls.env["account.analytic.account"].create(
{"name": "analytic account test", "plan_id": analytic_plan.id}
)
Expand Down
10 changes: 1 addition & 9 deletions stock_picking_analytic/views/stock_picking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
name="analytic_distribution"
widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
readonly="state in ['done', 'cancel']"
/>
<field name="analytic_distribution" invisible="1" />
</xpath>
Expand All @@ -25,15 +26,6 @@
{"default_analytic_distribution": analytic_distribution}
</attribute>
</xpath>
<xpath
expr="//notebook/page[@name='detailed_operations']
/field[@name='move_line_ids_without_package']"
position="attributes"
>
<attribute name="context" operation="update">
{"default_analytic_distribution": analytic_distribution}
</attribute>
</xpath>
</field>
</record>

Expand Down

0 comments on commit c73fd2f

Please sign in to comment.