Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] product_supplierinfo_for_customer_sale: menu for customer info #3143

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 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:2991b8bbe8c316a7b25bd0d1c76d8895ab45fb67c53dd8407e96193b0ecdd19b
!! source digest: sha256:11cc1a6ccc6bd8347d14b99e929f839301012ce0f1d5f8313b94dc0c0acebf10
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -77,6 +77,8 @@ To use this module, you need:
:alt: Search by exist customer code
:width: 600 px

- In Sales > Product > Product Customer Info, user can access a list view with all supplierinfos set in products, as well as create new ones.

Known issues / Roadmap
======================

Expand Down Expand Up @@ -115,6 +117,8 @@ Contributors
* Lois Rilo <lois.rilo@forgeflow.com>
* Juany Davila <juany.davila@forgeflow.com>
* Carlos Reyes <carlos@studio73.es>
* Ooops404 <https://www.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,13 @@
from odoo import api, fields, models


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

product_id = fields.Many2one(
compute="_compute_product_id", readonly=False, store=True
)

@api.depends("product_tmpl_id")
def _compute_product_id(self):
self.product_id = False

Check warning on line 13 in product_supplierinfo_for_customer_sale/models/product_customerinfo.py

View check run for this annotation

Codecov / codecov/patch

product_supplierinfo_for_customer_sale/models/product_customerinfo.py#L13

Added line #L13 was not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
* Lois Rilo <lois.rilo@forgeflow.com>
* Juany Davila <juany.davila@forgeflow.com>
* Carlos Reyes <carlos@studio73.es>
* Ooops404 <https://www.ooops404.com>
* Eduard Brahas <eduardbrhas@outlook.it>
2 changes: 2 additions & 0 deletions product_supplierinfo_for_customer_sale/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ To use this module, you need:
.. figure:: ../static/description/description_code_2.png
:alt: Search by exist customer code
:width: 600 px

- In Sales > Product > Product Customer Info, user can access a list view with all supplierinfos set in products, as well as create new ones.
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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.
Expand Down Expand Up @@ -275,7 +275,7 @@
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 }
Expand All @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -367,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:2991b8bbe8c316a7b25bd0d1c76d8895ab45fb67c53dd8407e96193b0ecdd19b
!! source digest: sha256:11cc1a6ccc6bd8347d14b99e929f839301012ce0f1d5f8313b94dc0c0acebf10
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/16.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-16-0/sale-workflow-16-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=16.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 @@ -422,6 +422,9 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<div class="figure">
<img alt="Search by exist customer code" src="https://raw.githubusercontent.com/OCA/sale-workflow/16.0/product_supplierinfo_for_customer_sale/static/description/description_code_2.png" style="width: 600px;" />
</div>
<ul class="simple">
<li>In Sales &gt; Product &gt; Product Customer Info, user can access a list view with all supplierinfos set in products, as well as create new ones.</li>
</ul>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
Expand Down Expand Up @@ -460,12 +463,16 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Juany Davila &lt;<a class="reference external" href="mailto:juany.davila&#64;forgeflow.com">juany.davila&#64;forgeflow.com</a>&gt;</li>
<li>Carlos Reyes &lt;<a class="reference external" href="mailto:carlos&#64;studio73.es">carlos&#64;studio73.es</a>&gt;</li>
<li>Ooops404 &lt;<a class="reference external" href="https://www.ooops404.com">https://www.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">
<h2><a class="toc-backref" href="#toc-entry-7">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>
Expand Down
85 changes: 85 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,89 @@
</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="mode">primary</field>
<field name="priority">99</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" 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="mode">primary</field>
<field name="priority">99</field>
<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="partner_id" />
<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':'partner_id'}"
/>
<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_ids"
eval="[
(5,0,0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('product_supplierinfo_for_customer_sale.product_customerinfo_tree_view')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('product_supplierinfo_for_customer_sale.product_customerinfo_form_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>
Loading