diff --git a/partner_product_price/__manifest__.py b/partner_product_price/__manifest__.py index c5f85afa97c1..70287c93f57f 100644 --- a/partner_product_price/__manifest__.py +++ b/partner_product_price/__manifest__.py @@ -7,10 +7,11 @@ "author": "Ows, Odoo Community Association (OCA)", "category": "Product", "data": [ - "data/ir_actions_server.xml", + "views/res_partner_views.xml", "views/product_product_views.xml", ], "depends": [ + "partner_stage", # inherit header "product", ], "development_status": "Alpha", diff --git a/partner_product_price/data/ir_actions_server.xml b/partner_product_price/data/ir_actions_server.xml deleted file mode 100644 index 80adc9fa3ca8..000000000000 --- a/partner_product_price/data/ir_actions_server.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - Products - - - - code - -action = env["ir.actions.actions"]._for_xml_id("product.product_normal_action_sell") -# action["domain"] = [("resource_booking_type_id", "!=", False)] -action["context"] = {'partner_id': record.id} - - - diff --git a/partner_product_price/models/__init__.py b/partner_product_price/models/__init__.py index 5c74c8c30f1e..0ab8ecd722db 100644 --- a/partner_product_price/models/__init__.py +++ b/partner_product_price/models/__init__.py @@ -1 +1,2 @@ from . import product_product +from . import res_partner diff --git a/partner_product_price/models/product_product.py b/partner_product_price/models/product_product.py index ba140f1014b1..ecab527433a3 100644 --- a/partner_product_price/models/product_product.py +++ b/partner_product_price/models/product_product.py @@ -27,4 +27,5 @@ def _compute_partner_and_price(self): partner_price = fields.Float( "Contact's Price", compute="_compute_partner_and_price", + digits=2, ) diff --git a/partner_product_price/models/res_partner.py b/partner_product_price/models/res_partner.py new file mode 100644 index 000000000000..10193b4726e4 --- /dev/null +++ b/partner_product_price/models/res_partner.py @@ -0,0 +1,11 @@ +from odoo import models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + def action_partner_product_price(self): + # Return a unique database action so filters may be saved towards the action. + return self.env["ir.actions.actions"]._for_xml_id( + "partner_product_price.product_product_action_sell" + ) diff --git a/partner_product_price/readme/CONTRIBUTORS.rst b/partner_product_price/readme/CONTRIBUTORS.rst index 76d51685e7a3..fc4dbc436607 100644 --- a/partner_product_price/readme/CONTRIBUTORS.rst +++ b/partner_product_price/readme/CONTRIBUTORS.rst @@ -1 +1 @@ -* Henrik Norlin (Ows) +* Henrik Norlin (https://ows.cloud) diff --git a/partner_product_price/views/product_product_views.xml b/partner_product_price/views/product_product_views.xml index b8b404702e37..2b8d80f5ad62 100644 --- a/partner_product_price/views/product_product_views.xml +++ b/partner_product_price/views/product_product_views.xml @@ -4,11 +4,23 @@ product.product.tree.inherit.partner.product.price product.product + primary - - - - + + + + + + Product Variants with Contact's Price + ir.actions.act_window + product.product + kanban,tree,form,activity + {"search_default_filter_to_sell": 1, "partner_id": active_id} + + + diff --git a/partner_product_price/views/res_partner_views.xml b/partner_product_price/views/res_partner_views.xml new file mode 100644 index 000000000000..463face37daa --- /dev/null +++ b/partner_product_price/views/res_partner_views.xml @@ -0,0 +1,18 @@ + + + + res.partner.form.inherit.partner_product_price + res.partner + + + +