Skip to content

Commit

Permalink
[IMP] product_supplierinfo_for_customer_sale: menu for customer info
Browse files Browse the repository at this point in the history
  • Loading branch information
toita86 committed Apr 26, 2024
1 parent 049f6db commit 324afe8
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 2 deletions.
4 changes: 3 additions & 1 deletion product_supplierinfo_for_customer_sale/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Product Supplierinfo for Customer Sale
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:11cc1a6ccc6bd8347d14b99e929f839301012ce0f1d5f8313b94dc0c0acebf10
!! source digest: sha256:15c994738b44170de29455df3f67bf8b58ffd1b72ec5306138ac466cc13d31d1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -113,6 +113,8 @@ Contributors
* Julio Serna Hernández <julio@vauxoo.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Ooops404 <info@ooops404.com>
* Eduard Brahas <eduardbrhas@outlook.it>

Maintainers
~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions product_supplierinfo_for_customer_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import sale_order_line
from . import product_customerinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from odoo import api, models


class SaleOrderLine(models.Model):
_inherit = "product.customerinfo"

@api.onchange("product_tmpl_id")
def onchange_product_tmpl_id(self):
self.product_id = False
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
* Julio Serna Hernández <julio@vauxoo.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Ooops404 <info@ooops404.com>
* Eduard Brahas <eduardbrhas@outlook.it>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?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>
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Product Supplierinfo for Customer Sale</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:11cc1a6ccc6bd8347d14b99e929f839301012ce0f1d5f8313b94dc0c0acebf10
!! source digest: sha256:15c994738b44170de29455df3f67bf8b58ffd1b72ec5306138ac466cc13d31d1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/sale-workflow/tree/14.0/product_supplierinfo_for_customer_sale"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-product_supplierinfo_for_customer_sale"><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/sale-workflow&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Based on product_supplierinfo_for_customer, this module loads in every sale order the
Expand Down Expand Up @@ -457,6 +458,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Julio Serna Hernández &lt;<a class="reference external" href="mailto:julio&#64;vauxoo.com">julio&#64;vauxoo.com</a>&gt;</li>
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Ooops404 &lt;<a class="reference external" href="mailto:info&#64;ooops404.com">info&#64;ooops404.com</a>&gt;
* Eduard Brahas &lt;<a class="reference external" href="mailto:eduardbrhas&#64;outlook.it">eduardbrhas&#64;outlook.it</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
75 changes: 75 additions & 0 deletions product_supplierinfo_for_customer_sale/views/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,79 @@
</xpath>
</field>
</record>

<record id="product_customerinfo_tree_view" model="ir.ui.view">
<field name="name">product.customerinfo.tree.view</field>
<field name="model">product.customerinfo</field>
<field
name="inherit_id"
ref="product_supplierinfo_for_customer.product_customerinfo_tree_view"
/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="before">
<field name="product_tmpl_id" />
</xpath>
</field>
</record>

<record id="product_customerinfo_form_view" model="ir.ui.view">
<field name="name">product.customerinfo.form.view</field>
<field name="model">product.customerinfo</field>
<field
name="inherit_id"
ref="product_supplierinfo_for_customer.product_customerinfo_form_view"
/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="before">
<field name="product_tmpl_id" required="1" />
</xpath>
</field>
</record>

<record id="product_customerinfo_view_search" model="ir.ui.view">
<field name="name">product.customerinfo.view.search</field>
<field name="model">product.customerinfo</field>
<field name="arch" type="xml">
<search string="Products">
<field name="name" />
<field name="product_tmpl_id" />
<field name="product_id" />
<field name="product_code" />
<field name="product_name" />
<group expand="1" string="Group By">
<filter
string="Customer"
name="customer"
context="{'group_by':'name'}"
/>
<filter
string="Product template"
name="productmpl"
context="{'group_by':'product_tmpl_id'}"
/>
<filter
string="Product variant"
name="productvar"
context="{'group_by':'product_id'}"
/>
</group>
</search>
</field>
</record>

<record id="action_product_customerinfo" model="ir.actions.act_window">
<field name="name">Products Customer info</field>
<field name="res_model">product.customerinfo</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="product_customerinfo_tree_view" />
<field name="help">This action displays products with customer info set.</field>
</record>

<menuitem
id="menu_product_customerinfo"
name="Product Customer info"
parent="sale.product_menu_catalog"
action="action_product_customerinfo"
/>

</odoo>

0 comments on commit 324afe8

Please sign in to comment.