From 10eee18a047d35305dc46282e610e88936d81ffc Mon Sep 17 00:00:00 2001 From: Akash Bhavsar Date: Mon, 9 Jan 2017 18:54:19 +0530 Subject: [PATCH] [IMP] product,sale,...: Restructure Product Form Purpose ======= - product form is a bit disorganized with fields showing up at wrong place: - inventory tab for services -> to remove - subscription & events fields under Invoicing tab - inventory tab is not structured - invoicing and bill control fields are not grouped together - etc. --- addons/account/views/product_view.xml | 13 ++--- addons/account_asset/views/product_views.xml | 5 +- .../delivery/views/product_template_view.xml | 2 +- addons/event_sale/models/product.py | 2 +- addons/event_sale/views/product_views.xml | 10 ++-- addons/point_of_sale/models/product.py | 2 +- addons/point_of_sale/views/product_view.xml | 2 +- addons/procurement/views/product_views.xml | 2 +- addons/product/models/product_template.py | 3 +- .../product/views/product_template_views.xml | 4 +- addons/product/views/product_views.xml | 29 ++++++----- .../views/product_views.xml | 5 +- .../views/product_template_views.xml | 24 +++++----- addons/purchase/models/purchase.py | 2 +- addons/purchase/views/purchase_views.xml | 30 +++++++----- .../views/purchase_requisition_views.xml | 10 ++-- .../models/report_intrastat.py | 2 +- .../views/report_intrastat_views.xml | 6 +-- addons/sale/models/product_template.py | 2 +- addons/sale/views/sale_views.xml | 16 +++++-- addons/sale_expense/views/product_view.xml | 2 +- addons/sale_stock/views/stock_views.xml | 24 +++++++++- addons/stock/views/product_views.xml | 48 ++++++++----------- addons/stock_account/views/product_views.xml | 6 +-- addons/stock_landed_costs/models/product.py | 2 +- .../views/product_views.xml | 4 +- addons/website_sale/views/product_views.xml | 2 +- 27 files changed, 144 insertions(+), 115 deletions(-) diff --git a/addons/account/views/product_view.xml b/addons/account/views/product_view.xml index 5dc56426ed3..2cc9b5a67b6 100644 --- a/addons/account/views/product_view.xml +++ b/addons/account/views/product_view.xml @@ -7,23 +7,24 @@ 5 - - + + - + + - - + + - + diff --git a/addons/account_asset/views/product_views.xml b/addons/account_asset/views/product_views.xml index 57f8c00c27a..d58c8ae31a0 100644 --- a/addons/account_asset/views/product_views.xml +++ b/addons/account_asset/views/product_views.xml @@ -6,10 +6,11 @@ product.template - + + context="{'default_type': 'purchase'}" + groups="account.group_account_user"/> diff --git a/addons/delivery/views/product_template_view.xml b/addons/delivery/views/product_template_view.xml index 45256f3aac5..9073377f826 100644 --- a/addons/delivery/views/product_template_view.xml +++ b/addons/delivery/views/product_template_view.xml @@ -6,7 +6,7 @@ product.template - + diff --git a/addons/event_sale/models/product.py b/addons/event_sale/models/product.py index 67fade67f6b..fb03a5b250b 100644 --- a/addons/event_sale/models/product.py +++ b/addons/event_sale/models/product.py @@ -6,7 +6,7 @@ from odoo import api, fields, models class ProductTemplate(models.Model): _inherit = 'product.template' - event_ok = fields.Boolean(string='Event Registration', help='Determine if a product needs ' + event_ok = fields.Boolean(string='Is an Event Ticket', help='Determine if a product needs ' 'to create automatically an event registration at the confirmation of a sales order line.') @api.onchange('event_ok') diff --git a/addons/event_sale/views/product_views.xml b/addons/event_sale/views/product_views.xml index 90eeb481b4b..52d43f67b6d 100644 --- a/addons/event_sale/views/product_views.xml +++ b/addons/event_sale/views/product_views.xml @@ -3,11 +3,13 @@ product.template.event.form.inherit product.template - + - - - + + + + + diff --git a/addons/point_of_sale/models/product.py b/addons/point_of_sale/models/product.py index 4e350eed91c..6bae7c2d464 100644 --- a/addons/point_of_sale/models/product.py +++ b/addons/point_of_sale/models/product.py @@ -7,7 +7,7 @@ from odoo.exceptions import UserError class ProductTemplate(models.Model): _inherit = 'product.template' - available_in_pos = fields.Boolean(string='Available in the Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=True) + available_in_pos = fields.Boolean(string='Available in Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=True) to_weight = fields.Boolean(string='To Weigh With Scale', help="Check if the product should be weighted using the hardware scale integration") pos_categ_id = fields.Many2one( 'pos.category', string='Point of Sale Category', diff --git a/addons/point_of_sale/views/product_view.xml b/addons/point_of_sale/views/product_view.xml index 8c06471cc32..ced1a008238 100644 --- a/addons/point_of_sale/views/product_view.xml +++ b/addons/point_of_sale/views/product_view.xml @@ -57,7 +57,7 @@ product.template - + diff --git a/addons/procurement/views/product_views.xml b/addons/procurement/views/product_views.xml index 9e4e0567846..a85607c29fd 100644 --- a/addons/procurement/views/product_views.xml +++ b/addons/procurement/views/product_views.xml @@ -10,7 +10,7 @@ - + diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index 042bbcc4359..c62732aa306 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -50,7 +50,7 @@ - - - - -
@@ -88,13 +80,24 @@ attrs="{'invisible':[('type', '!=', 'service')]}"/> + + + + + - - + + - + + + + @@ -308,7 +311,7 @@ - + diff --git a/addons/product_email_template/views/product_views.xml b/addons/product_email_template/views/product_views.xml index 7e652754756..f4101189981 100644 --- a/addons/product_email_template/views/product_views.xml +++ b/addons/product_email_template/views/product_views.xml @@ -6,11 +6,11 @@ - Miscellaneous + Email - - /> diff --git a/addons/product_expiry/views/product_template_views.xml b/addons/product_expiry/views/product_template_views.xml index a8587dbb530..b68ab2aa19d 100644 --- a/addons/product_expiry/views/product_template_views.xml +++ b/addons/product_expiry/views/product_template_views.xml @@ -5,26 +5,26 @@ product.template - - -