Skip to content

Commit

Permalink
[MIG] fieldservice_equipment_stock: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
szekawong committed Apr 15, 2024
1 parent 32c77a0 commit 2dc1ed7
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 27 deletions.
12 changes: 6 additions & 6 deletions fieldservice_equipment_stock/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Field Service - Stock Equipment
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f79d3f7f18efdac99fcffbc3dd3ee92407b73ea5b7702569bf4e28ca799f5f0f
!! source digest: sha256:60636d35efda73608a27ac5bcaedb6220163f12665a388b90db0d2b4c4d2312e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Field Service - Stock Equipment
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github
:target: https://github.com/OCA/field-service/tree/15.0/fieldservice_equipment_stock
:target: https://github.com/OCA/field-service/tree/16.0/fieldservice_equipment_stock
:alt: OCA/field-service
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_equipment_stock
:target: https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_equipment_stock
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/field-service&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -78,7 +78,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/field-service/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_equipment_stock%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_equipment_stock%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -136,6 +136,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-brian10048| |maintainer-wolfhall| |maintainer-max3903| |maintainer-smangukiya|

This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/15.0/fieldservice_equipment_stock>`_ project on GitHub.
This module is part of the `OCA/field-service <https://github.com/OCA/field-service/tree/16.0/fieldservice_equipment_stock>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions fieldservice_equipment_stock/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Field Service - Stock Equipment",
"summary": "Integrate stock operations with your field service equipments",
"version": "15.0.1.0.1",
"version": "16.0.1.0.0",
"category": "Field Service",
"author": "Open Source Integrators, "
"Brian McMaster, "
Expand All @@ -18,7 +18,7 @@
"views/fsm_equipment.xml",
"views/product_template.xml",
"views/stock_picking_type.xml",
"views/stock_production_lot.xml",
"views/stock_lot.xml",
],
"license": "AGPL-3",
"development_status": "Beta",
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_equipment_stock/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
stock_picking_type,
fsm_equipment,
product_template,
stock_production_lot,
stock_lot,
)
15 changes: 8 additions & 7 deletions fieldservice_equipment_stock/models/fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FSMEquipment(models.Model):
_inherit = "fsm.equipment"

product_id = fields.Many2one("product.product", string="Product", required=True)
lot_id = fields.Many2one("stock.production.lot", string="Serial #", required=True)
lot_id = fields.Many2one("stock.lot", string="Serial #", required=True)
current_stock_location_id = fields.Many2one(
"stock.location",
string="Current Inventory Location",
Expand All @@ -30,12 +30,13 @@ def _compute_current_stock_loc_id(self):
def _onchange_product(self):
self.current_stock_location_id = False

@api.model
def create(self, vals):
res = super(FSMEquipment, self).create(vals)
if "lot_id" in vals:
res.lot_id.fsm_equipment_id = res.id
return res
@api.model_create_multi
def create(self, vals_list):
equipments = super(FSMEquipment, self).create(vals_list)
for equipment in equipments:
if equipment.lot_id:
equipment.lot_id.fsm_equipment_id = equipment.id
return equipments

def write(self, vals):
res = super(FSMEquipment, self).write(vals)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from odoo import fields, models


class StockProductionLot(models.Model):
_inherit = "stock.production.lot"
class StockLot(models.Model):
_inherit = "stock.lot"

fsm_equipment_id = fields.Many2one(
"fsm.equipment", string="Equipment", readonly=True
Expand Down
3 changes: 3 additions & 0 deletions fieldservice_equipment_stock/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
* Sandip Mangukiya <smangukiya@opensourceintegrators.com>
* Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
* Marcel Savegnago <marcel.savegnago@escodoo.com.br>
* `XCG Consulting <https://xcg-consulting.fr>`_:

* Szeka Wong
8 changes: 4 additions & 4 deletions fieldservice_equipment_stock/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Field Service - Stock Equipment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f79d3f7f18efdac99fcffbc3dd3ee92407b73ea5b7702569bf4e28ca799f5f0f
!! source digest: sha256:60636d35efda73608a27ac5bcaedb6220163f12665a388b90db0d2b4c4d2312e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/field-service/tree/15.0/fieldservice_equipment_stock"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-15-0/field-service-15-0-fieldservice_equipment_stock"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/field-service/tree/16.0/fieldservice_equipment_stock"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_equipment_stock"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/field-service&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module is an add-on for the Field Service application in Odoo.
It allows you to track your FSM Equipments in stock moves.</p>
<p><strong>Table of contents</strong></p>
Expand Down Expand Up @@ -426,7 +426,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/field-service/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_equipment_stock%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/field-service/issues/new?body=module:%20fieldservice_equipment_stock%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -463,7 +463,7 @@ <h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/brian10048"><img alt="brian10048" src="https://github.com/brian10048.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/wolfhall"><img alt="wolfhall" src="https://github.com/wolfhall.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/smangukiya"><img alt="smangukiya" src="https://github.com/smangukiya.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/15.0/fieldservice_equipment_stock">OCA/field-service</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/field-service/tree/16.0/fieldservice_equipment_stock">OCA/field-service</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_equipment_stock/tests/test_fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setUp(self):
"tracking": "serial",
}
)
self.lot1 = self.env["stock.production.lot"].create(
self.lot1 = self.env["stock.lot"].create(
{
"name": "serial1",
"product_id": self.product1.id,
Expand Down
4 changes: 2 additions & 2 deletions fieldservice_equipment_stock/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<field name="tracking" position="after">
<group name="traceability" position="inside">
<field
name="create_fsm_equipment"
attrs="{'invisible': [('tracking', '!=', 'serial')]}"
/>
</field>
</group>
</field>
</record>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<odoo>

<record id="stock_production_lot_extend_equipment" model="ir.ui.view">
<field name="model">stock.production.lot</field>
<record id="stock_lot_extend_equipment" model="ir.ui.view">
<field name="model">stock.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form" />
<field name="arch" type="xml">
<xpath
Expand Down

0 comments on commit 2dc1ed7

Please sign in to comment.