[MIG] product_quick_bom: Migration to 13.0

This commit is contained in:
ps-tubtim
2020-09-09 10:37:19 +07:00
parent aaf95c4cb4
commit fb3e43264c
7 changed files with 57 additions and 26 deletions

View File

@@ -14,13 +14,13 @@ Product Quick Bom
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/12.0/product_quick_bom
:target: https://github.com/OCA/manufacture/tree/13.0/product_quick_bom
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-product_quick_bom
:target: https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-product_quick_bom
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/129/12.0
:target: https://runbot.odoo-community.org/runbot/129/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -45,7 +45,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20product_quick_bom%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20product_quick_bom%0Aversion:%2013.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.
@@ -62,6 +62,7 @@ Contributors
* Sébastien Beau <sebastien.beau@akretion.com>
* Kevin Khao <kevin.khao@akretion.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
Maintainers
~~~~~~~~~~~
@@ -87,6 +88,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-sebastienbeau| |maintainer-kevinkhao|
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/12.0/product_quick_bom>`_ project on GitHub.
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/13.0/product_quick_bom>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -16,9 +16,9 @@ class ProductTemplate(models.Model):
rec.bom_id = self.env["mrp.bom"]
bom_id = fields.Many2one(
"mrp.bom",
comodel_name="mrp.bom",
string="Bill of Materials (quick access)",
compute=_compute_bom_id,
compute="_compute_bom_id",
store=True,
)

View File

@@ -1,2 +1,3 @@
* Sébastien Beau <sebastien.beau@akretion.com>
* Kevin Khao <kevin.khao@akretion.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/manufacture/tree/12.0/product_quick_bom"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-product_quick_bom"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/manufacture/tree/13.0/product_quick_bom"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/manufacture-13-0/manufacture-13-0-product_quick_bom"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/129/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module was written to be able to quickly create the BoM for your product. There is a new “Bill of Materials” tab in the product form view that allows the user to add a BoM and its lines directly.</p>
<p>Beware that this functionality is relevant only when one product template has one Bill of Materials, and works only for product templates for simplicitys sake.</p>
<p><strong>Table of contents</strong></p>
@@ -392,7 +392,7 @@ ul.auto-toc {
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20product_quick_bom%0Aversion:%2012.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/manufacture/issues/new?body=module:%20product_quick_bom%0Aversion:%2013.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">
@@ -408,6 +408,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<ul class="simple">
<li>Sébastien Beau &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</li>
<li>Kevin Khao &lt;<a class="reference external" href="mailto:kevin.khao&#64;akretion.com">kevin.khao&#64;akretion.com</a>&gt;</li>
<li>Pimolnat Suntian &lt;<a class="reference external" href="mailto:pimolnats&#64;ecosoft.co.th">pimolnats&#64;ecosoft.co.th</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -419,7 +420,7 @@ mission is to support the collaborative development of Odoo features and
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" href="https://github.com/sebastienbeau"><img alt="sebastienbeau" src="https://github.com/sebastienbeau.png?size=40px" /></a> <a class="reference external" href="https://github.com/kevinkhao"><img alt="kevinkhao" src="https://github.com/kevinkhao.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/12.0/product_quick_bom">OCA/manufacture</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/13.0/product_quick_bom">OCA/manufacture</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>

View File

@@ -1,27 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="product_template_only_form_view_bomlines" model="ir.ui.view">
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<xpath expr="//page[@name='sales']" position="after">
<xpath expr="//notebook" position="inside">
<page name="bom_line" string="Bill of Materials">
<div attrs="{'invisible': [('bom_count', '&lt;', 2)]}"
class="alert alert-danger text-center"
role="alert">
<p>The product is linked to several BoMs, modifications must be done BoM-side.</p>
<div
attrs="{'invisible': [('bom_count', '&lt;', 2)]}"
class="alert alert-danger text-center"
role="alert"
>
<p
>The product is linked to several BoMs, modifications must be done BoM-side.</p>
</div>
<div attrs="{'invisible': [('bom_count', '!=', 0)]}"
class="alert alert-danger text-center"
role="alert">
<p>The product doesn't have a BoM yet, you must create one before updating its components.</p>
<button name="button_create_bom" type="object" string="Create BoM"/>
<div
attrs="{'invisible': [('bom_count', '!=', 0)]}"
class="alert alert-danger text-center"
role="alert"
>
<p
>The product doesn't have a BoM yet, you must create one before updating its components.</p>
<button
name="button_create_bom"
type="object"
string="Create BoM"
/>
</div>
<field name="specific_bom_line_ids" attrs="{'invisible': [('bom_count', '!=', 1)]}">
<field
name="specific_bom_line_ids"
attrs="{'invisible': [('bom_count', '!=', 1)]}"
>
<tree editable="bottom">
<field name="product_id"/>
<field name="product_qty"/>
<field name="attribute_value_ids" widget="many2many_tags"/>
<field name="company_id" invisible="1" />
<field name="product_id" />
<field name="product_qty" />
<field
name="possible_bom_product_template_attribute_value_ids"
invisible="1"
/>
<field
name="bom_product_template_attribute_value_ids"
widget="many2many_tags"
/>
</tree>
</field>
</page>

View File

@@ -0,0 +1 @@
../../../../product_quick_bom

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)