@@ -310,6 +310,7 @@
+
diff --git a/addons/point_of_sale/models/product.py b/addons/point_of_sale/models/product.py
index 9febe9e985b..609b220dbdd 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 Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=False)
+ available_in_pos = fields.Boolean(string='Available in POS', help='Check if you want this product to appear in the Point of Sale', default=False)
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 96f92c5d7be..6e0a4846732 100644
--- a/addons/point_of_sale/views/product_view.xml
+++ b/addons/point_of_sale/views/product_view.xml
@@ -52,13 +52,17 @@
product.template
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml
index 61c7bba55f2..272f979acc4 100644
--- a/addons/product/views/product_views.xml
+++ b/addons/product/views/product_views.xml
@@ -60,7 +60,40 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -72,41 +105,7 @@
m³
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- product.template
-
- Email
-
-
-
+
+ Automatic Email at Invoice
+ 0
+
+
-
+
diff --git a/addons/purchase/views/product_views.xml b/addons/purchase/views/product_views.xml
index 5fb164080a1..cf8dbffe806 100644
--- a/addons/purchase/views/product_views.xml
+++ b/addons/purchase/views/product_views.xml
@@ -8,6 +8,9 @@
product.template
+
+ 0
+
diff --git a/addons/sale/models/product_template.py b/addons/sale/models/product_template.py
index 98edf5eb28c..e8b0390037c 100644
--- a/addons/sale/models/product_template.py
+++ b/addons/sale/models/product_template.py
@@ -18,7 +18,28 @@ class ProductTemplate(models.Model):
expense_policy = fields.Selection(
[('no', 'No'), ('cost', 'At cost'), ('sales_price', 'Sales price')],
string='Re-Invoice Policy',
- default='no')
+ default='no',
+ help="Expenses registered in Expense app or in a vendor bill (with an analytic account set) "
+ "can be automatically re-invoiced to the customer. This is useful for customer projects. "
+ "With this option activated, the validated expense is added to the sales order linked to the "
+ "analytic account, in order to be invoiced. With Project Management, such an analytic account "
+ "can be automatically generated at the order confirmation, if set on the Service Tracking "
+ "option of one product item.")
+ sales_count = fields.Float(compute='_compute_sales_count', string='Sold')
+ hide_expense_policy = fields.Boolean(compute='_compute_hide_expense_policy')
+ invoice_policy = fields.Selection(
+ [('order', 'Ordered quantities'),
+ ('delivery', 'Delivered quantities'),
+ ], string='Invoicing Policy',
+ help='Ordered Quantity: Invoice based on the quantity the customer ordered.\n'
+ 'Delivered Quantity: Invoiced based on the quantity the vendor delivered (time or deliveries).',
+ default='order')
+
+ @api.multi
+ def _compute_hide_expense_policy(self):
+ hide_expense_policy = self.user_has_groups('!analytic.group_analytic_accounting,!project.group_project_user,!hr_expense.group_hr_expense_user')
+ for template in self:
+ template.hide_expense_policy = hide_expense_policy
@api.multi
@api.depends('product_variant_ids.sales_count')
@@ -44,15 +65,6 @@ class ProductTemplate(models.Model):
'domain': [('state', 'in', ['sale', 'done']), ('product_id.product_tmpl_id', '=', self.id)],
}
- sales_count = fields.Integer(compute='_sales_count', string='# Sales')
- invoice_policy = fields.Selection(
- [('order', 'Ordered quantities'),
- ('delivery', 'Delivered quantities'),
- ], string='Invoicing Policy',
- help='Ordered Quantity: Invoice based on the quantity the customer ordered.\n'
- 'Delivered Quantity: Invoiced based on the quantity the vendor delivered (time or deliveries).',
- default='order')
-
@api.onchange('type')
def _onchange_type(self):
""" Force values to stay consistent with integrity constraints """
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
index 761333e3920..f2692de0397 100644
--- a/addons/sale/views/sale_views.xml
+++ b/addons/sale/views/sale_views.xml
@@ -929,17 +929,14 @@
product.template
-
+
+
+
-
-
-
-
-
-
+
diff --git a/addons/sale_expense/views/product_view.xml b/addons/sale_expense/views/product_view.xml
index 10c91862ac8..9387d655943 100644
--- a/addons/sale_expense/views/product_view.xml
+++ b/addons/sale_expense/views/product_view.xml
@@ -12,6 +12,12 @@
+
+
+
+
+
+
diff --git a/addons/sale_management/views/sale_management_views.xml b/addons/sale_management/views/sale_management_views.xml
index 888ff8376b8..1861502125e 100644
--- a/addons/sale_management/views/sale_management_views.xml
+++ b/addons/sale_management/views/sale_management_views.xml
@@ -100,4 +100,15 @@
+
+ product.template.sales
+ product.template
+
+
+
+ 0
+
+
+
+
diff --git a/addons/sale_stock/__manifest__.py b/addons/sale_stock/__manifest__.py
index f53ee7b3e3e..a1be951ecbc 100644
--- a/addons/sale_stock/__manifest__.py
+++ b/addons/sale_stock/__manifest__.py
@@ -33,7 +33,6 @@ You can choose flexible invoicing methods:
'views/res_config_settings_views.xml',
'views/account_invoice_views.xml',
'views/sale_stock_portal_template.xml',
- 'views/product_template_views.xml',
'views/res_users_views.xml',
'views/stock_production_lot_views.xml',
'report/sale_order_report_templates.xml',
diff --git a/addons/sale_stock/views/product_template_views.xml b/addons/sale_stock/views/product_template_views.xml
deleted file mode 100644
index 9edec3db317..00000000000
--- a/addons/sale_stock/views/product_template_views.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
- product.template.form.expense.policy.inherit
- product.template
-
-
-
- {'invisible': [('type','=', 'product')]}
-
-
-
-
-
diff --git a/addons/sale_timesheet/models/product.py b/addons/sale_timesheet/models/product.py
index ceb8273549b..10da8cc6127 100644
--- a/addons/sale_timesheet/models/product.py
+++ b/addons/sale_timesheet/models/product.py
@@ -12,7 +12,7 @@ class ProductTemplate(models.Model):
('ordered_timesheet', 'Ordered quantities'),
('delivered_timesheet', 'Timesheets on tasks'),
('delivered_manual', 'Milestones (manually set quantities on order)')
- ], string="Invoice based on", compute='_compute_service_policy', inverse='_inverse_service_policy')
+ ], string="Service Invoicing Policy", compute='_compute_service_policy', inverse='_inverse_service_policy')
service_type = fields.Selection(selection_add=[
('timesheet', 'Timesheets on project (one fare per SO/Project)'),
])
diff --git a/addons/sale_timesheet/views/product_views.xml b/addons/sale_timesheet/views/product_views.xml
index aea6f60a959..827cc9e2e74 100644
--- a/addons/sale_timesheet/views/product_views.xml
+++ b/addons/sale_timesheet/views/product_views.xml
@@ -18,20 +18,6 @@
-
- product.template.search.timesheet
- product.template
-
-
-
-
-
-
-
-
-
-
-
Productsproduct.template
diff --git a/addons/stock/views/product_views.xml b/addons/stock/views/product_views.xml
index 4abd3836c22..59e7289ea75 100644
--- a/addons/stock/views/product_views.xml
+++ b/addons/stock/views/product_views.xml
@@ -62,17 +62,17 @@
product.template.search.stock.formproduct.template
+ primary
-
+
-
-
-
+
+
@@ -82,23 +82,21 @@
product.template
-
-
-
-
-
-
-