diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index 850a8f49842..160df652dcb 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -125,7 +125,7 @@ module named account_voucher.
'board_account_view.xml',
"edi/invoice_action_data.xml",
"account_bank_view.xml",
- "account_pre_install.yml"
+# "account_pre_install.yml"
],
'demo_xml': [
'demo/account_demo.xml',
diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml
index 430d65e0bf9..6007d45ba10 100644
--- a/addons/account/account_installer.xml
+++ b/addons/account/account_installer.xml
@@ -54,13 +54,13 @@
Accounting
5
-
+
-
-
- 3
- automatic
-
+
+
+ 3
+ automatic
+
Review your Financial Accounts
diff --git a/addons/account/test/test_edi_invoice.yml b/addons/account/test/test_edi_invoice.yml
index e2c0f21e7da..c36672c4531 100644
--- a/addons/account/test/test_edi_invoice.yml
+++ b/addons/account/test/test_edi_invoice.yml
@@ -50,72 +50,72 @@
!python {model: account.invoice}: |
import time
edi_document = {
- "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
- "__module": "account",
- "__model": "account.invoice",
- "__version": [6,1,0],
- "internal_number": time.strftime("SAJ/%Y/002"),
+ "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.random_invoice_763jsms",
+ "__module": "account",
+ "__model": "account.invoice",
+ "__version": [6,1,0],
+ "internal_number": time.strftime("SAJ/%Y/002"),
"company_address": {
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.main_address",
"__module": "base",
- "__model": "res.partner.address",
- "city": "Gerompont",
- "zip": "1367",
- "country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"],
- "phone": "(+32).81.81.37.00",
+ "__model": "res.partner.address",
+ "city": "Gerompont",
+ "zip": "1367",
+ "country_id": ["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.be", "Belgium"],
+ "phone": "(+32).81.81.37.00",
"street": "Chaussee de Namur 40",
"bank_ids": [
["base:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_bank-ZrTWzesfsdDJzGbp","Sample bank: 123465789-156113"]
],
- },
- "company_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_company_test11", "Thomson pvt. ltd."],
+ },
+ "company_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_company_test11", "Thomson pvt. ltd."],
"currency": {
"__id": "base:b22acf7a-ddcd-11e0-a4db-701a04e25543.EUR",
"__module": "base",
"__model": "res.currency",
"code": "EUR",
"symbol": "€",
- },
+ },
"partner_id": ["account:b22acf7a-ddcd-11e0-a4db-701a04e25543.res_partner_test20", "Junjun wala"],
"partner_address": {
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh",
"__module": "base",
"__model": "res.partner.address",
- "phone": "(+32).81.81.37.00",
- "street": "Chaussee de Namur 40",
- "city": "Gerompont",
- "zip": "1367",
- "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
+ "phone": "(+32).81.81.37.00",
+ "street": "Chaussee de Namur 40",
+ "city": "Gerompont",
+ "zip": "1367",
+ "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
},
- "date_invoice": time.strftime('%Y-%m-%d'),
- "name": "sample invoice",
+ "date_invoice": time.strftime('%Y-%m-%d'),
+ "name": "sample invoice",
"tax_line": [{
- "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
+ "__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_tax-4g4EutbiEMVl",
"__module": "account",
- "__model": "account.invoice.tax",
- "amount": 1000.0,
- "manual": True,
- "name": "sale tax",
- }],
- "type": "out_invoice",
+ "__model": "account.invoice.tax",
+ "amount": 1000.0,
+ "manual": True,
+ "name": "sale tax",
+ }],
+ "type": "out_invoice",
"invoice_line": [{
"__module": "account",
"__model": "account.invoice.line",
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-1RP3so",
- "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
- "name": "Basic PC",
- "price_unit": 10.0,
- "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
+ "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"],
+ "name": "Basic PC",
+ "price_unit": 10.0,
+ "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
"quantity": 1.0
},
{
"__module": "account",
"__model": "account.invoice.line",
"__id": "account:b22acf7a-ddcd-11e0-a4db-701a04e25543.account_invoice_line-u2XV5",
- "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "PCE"],
- "name": "Medium PC",
- "price_unit": 100.0,
- "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
+ "uos_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_uom_unit", "Unit"],
+ "name": "Medium PC",
+ "price_unit": 100.0,
+ "product_id": ["product:b22acf7a-ddcd-11e0-a4db-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
"quantity": 5.0
}]
}
@@ -137,12 +137,12 @@
assert len(invoice_new.invoice_line) == 2, "invoice lines are not same"
for inv_line in invoice_new.invoice_line:
if inv_line.name == 'Basic PC':
- assert inv_line.uos_id.name == "PCE" , "uom is not same"
+ assert inv_line.uos_id.name == "Unit" , "uom is not same"
assert inv_line.price_unit == 10 , "price unit is not same"
assert inv_line.quantity == 1 , "product qty is not same"
assert inv_line.price_subtotal == 10, "price sub total is not same"
elif inv_line.name == 'Medium PC':
- assert inv_line.uos_id.name == "PCE" , "uom is not same"
+ assert inv_line.uos_id.name == "Unit" , "uom is not same"
assert inv_line.price_unit == 100 , "price unit is not same"
assert inv_line.quantity == 5 , "product qty is not same"
assert inv_line.price_subtotal == 500, "price sub total is not same"
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 60d30f9fff0..5633958efc0 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -3,15 +3,15 @@
- account.analytic.account.invoice.stat.form.inherit
- account.analytic.account
- form
+ account.analytic.account.invoice.stat.form.inherit
+ account.analytic.account
+ form
@@ -30,9 +30,9 @@
- account.analytic.account.invoice.form.inherit
- account.analytic.account
- form
+ account.analytic.account.invoice.form.inherit
+ account.analytic.account
+ form
@@ -69,7 +69,7 @@
-
+
@@ -97,19 +97,35 @@
-
-
- account.analytic.account.tree
- account.analytic.account
+
+
+ account.analytic.account.tree
+ account.analytic.account
- tree
-
-
+ tree
+
+
+
+ Sales Application
+ sale.configuration
+
+ form
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py
index 9f95a430f4e..cc2b66dd9e7 100644
--- a/addons/delivery/delivery.py
+++ b/addons/delivery/delivery.py
@@ -106,7 +106,7 @@ class delivery_carrier(osv.osv):
# if using advanced pricing per destination: do not change
if record.use_detailed_pricelist:
continue
-
+
# not using advanced pricing per destination: override grid
grid_id = grid_pool.search(cr, uid, [('carrier_id', '=', record.id)], context=context)
@@ -250,23 +250,23 @@ class delivery_grid_line(osv.osv):
delivery_grid_line()
-class define_delivery_steps(osv.osv_memory):
- _name = 'delivery.define.delivery.steps.wizard'
-
- _columns = {
- 'picking_policy' : fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], 'Picking Policy'),
- }
- _defaults = {
- 'picking_policy': lambda s,c,u,ctx: s.pool.get('sale.order').default_get(c,u,['picking_policy'],context=ctx)['picking_policy']
- }
-
- def apply_cb(self, cr, uid, ids, context=None):
- ir_values_obj = self.pool.get('ir.values')
- wizard = self.browse(cr, uid, ids, context=context)[0]
- ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], wizard.picking_policy)
- return {'type' : 'ir.actions.act_window_close'}
-
-define_delivery_steps()
+#class define_delivery_steps(osv.osv_memory):
+# _name = 'delivery.define.delivery.steps.wizard'
+#
+# _columns = {
+# 'picking_policy' : fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], 'Picking Policy'),
+# }
+# _defaults = {
+# 'picking_policy': lambda s,c,u,ctx: s.pool.get('sale.order').default_get(c,u,['picking_policy'],context=ctx)['picking_policy']
+# }
+#
+# def apply_cb(self, cr, uid, ids, context=None):
+# ir_values_obj = self.pool.get('ir.values')
+# wizard = self.browse(cr, uid, ids, context=context)[0]
+# ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], wizard.picking_policy)
+# return {'type' : 'ir.actions.act_window_close'}
+#
+#define_delivery_steps()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index 1e47d815084..4928f77bc3e 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -337,7 +337,7 @@
10
-
+
diff --git a/addons/delivery/test/delivery_cost.yml b/addons/delivery/test/delivery_cost.yml
index f8d6787a0c5..0a431d578c8 100644
--- a/addons/delivery/test/delivery_cost.yml
+++ b/addons/delivery/test/delivery_cost.yml
@@ -67,9 +67,6 @@
-
I set default delivery policy.
-
- !record {model: delivery.define.delivery.steps.wizard, id: default_delivery_policy}:
+ !record {model: sale.configuration, id: default_delivery_policy}:
{}
--
- !python {model: delivery.define.delivery.steps.wizard}: |
- self.apply_cb(cr, uid, [ref('default_delivery_policy')], context=context)
diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml
index 37b924f319f..68e265e0730 100644
--- a/addons/plugin_outlook/plugin_outlook.xml
+++ b/addons/plugin_outlook/plugin_outlook.xml
@@ -48,11 +48,16 @@
new
-
-
-
- 4
- automatic
+
+ Sales Application
+ sale.configuration
+ form
+
+
+
+
+
+
diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml
index 3b4107c8358..76405330c89 100644
--- a/addons/plugin_thunderbird/plugin_thunderbird.xml
+++ b/addons/plugin_thunderbird/plugin_thunderbird.xml
@@ -54,11 +54,17 @@
form
new
-
-
-
- 3
- automatic
+
+
+ Sales Application
+ sale.configuration
+ form
+
+
+
+
+
+
diff --git a/addons/product/partner_view.xml b/addons/product/partner_view.xml
index 51d012b8577..f40c5ab8032 100644
--- a/addons/product/partner_view.xml
+++ b/addons/product/partner_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/product/pricelist_view.xml b/addons/product/pricelist_view.xml
index 3ddfe1e6900..ebd99986991 100644
--- a/addons/product/pricelist_view.xml
+++ b/addons/product/pricelist_view.xml
@@ -4,7 +4,7 @@
-
+
product.pricelist.version.form
@@ -195,7 +195,7 @@
-
+
Price Types
ir.actions.act_window
diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml
index 0233a5a4788..3e2d114dc74 100644
--- a/addons/product/product_data.xml
+++ b/addons/product/product_data.xml
@@ -27,7 +27,7 @@
-->
- PCE
+ Unit
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 82bfda7b580..0a7b2c2a47e 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -28,6 +28,7 @@ from tools.translate import _
from tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, float_compare
import decimal_precision as dp
import netsvc
+from openerp.addons.base.res import res_config_sale as sale_config
class sale_shop(osv.osv):
_name = "sale.shop"
@@ -789,7 +790,7 @@ class sale_order(osv.osv):
return True
def _get_date_planned(self, cr, uid, order, line, start_date, context=None):
- date_planned = datetime.strptime(start_date, DEFAULT_SERVER_DATE_FORMAT) + relativedelta(days=line.delay or 0.0)
+ date_planned = datetime.strptime(start_date, DEFAULT_SERVER_DATE_FORMAT) + relativedelta(days=line.delay or 0.0)
date_planned = (date_planned - timedelta(days=order.company_id.security_lead)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
return date_planned
@@ -1330,12 +1331,15 @@ class sale_order_line(osv.osv):
sale_order_line()
-class sale_config_picking_policy(osv.osv_memory):
- _name = 'sale.config.picking_policy'
- _inherit = 'res.config'
+sale_config.MODULE_LIST += [
+ 'project_timesheet', 'account_analytic_analysis', 'project_mrp', 'delivery',
+ 'sale_margin', 'sale_journal'
+]
+
+class sale_configuration(osv.osv_memory):
+ _inherit = 'sale.configuration'
_columns = {
- 'name': fields.char('Name', size=64),
'sale_orders': fields.boolean('Based on Sales Orders',),
'deli_orders': fields.boolean('Based on Delivery Orders'),
'task_work': fields.boolean('Based on Tasks\' Work'),
@@ -1345,27 +1349,103 @@ class sale_config_picking_policy(osv.osv_memory):
('picking', 'Invoice Based on Deliveries'),
], 'Main Method Based On', required=True, help="You can generate invoices based on sales orders or based on shippings."),
'charge_delivery': fields.boolean('Do you charge the delivery?'),
- 'time_unit': fields.many2one('product.uom','Main Working Time Unit')
+ 'time_unit': fields.many2one('product.uom','Working Time Unit'),
+ 'picking_policy' : fields.boolean("Deliver all products at once?"),
+ 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer ",help="Group to Activate pricelist to manage prices per customer"),
+ 'group_sale_uom_per_product':fields.boolean("UOM per product",help="Group to Allow different unit of measure per product"),
+ 'group_sale_delivery_address':fields.boolean("Multiple Address",help="Group To Allow delivery address different from invoice address"),
+ 'group_sale_disc_per_sale_order_line':fields.boolean("Discounts per sale order lines ",help="Group to apply discounts per sale order lines"),
+ 'sale_layout':fields.boolean("Notes & subtotals per line",help="Install sale_layout module: This module provides features to improve the layout of the Sales Order.."),
+ 'warning': fields.boolean("Alerts by products or customers",
+ help="Install warning module: Module to trigger warnings in OpenERP objects."),
+ 'tax_value' : fields.float('Value'),
+ 'tax_value_id': fields.many2one('account.tax.template'),
+ 'tax_policy': fields.selection([
+ ('no_tax', 'No Tax'),
+ ('global_on_order', 'Global On Order'),
+ ('on_order_line', 'On Order Lines'),
+ ], 'Taxes', required=True),
+ 'sale_margin': fields.boolean("Display Margin For Users",
+ help="Install sale_margin module: This module adds the 'Margin' on sales order."),
+ 'sale_journal': fields.boolean("Invoice journal?",
+ help="Install sale_journal module: The sales journal modules allows you to categorise your sales and deliveries (picking lists) between different journals."),
}
+
+ def default_get(self, cr, uid, fields_list, context=None):
+ ir_values_obj = self.pool.get('ir.values')
+ data_obj = self.pool.get('ir.model.data')
+ obj_tax_temp = self.pool.get('account.tax.template')
+ res = super(sale_configuration, self).default_get(
+ cr, uid, fields_list, context=context)
+ defaults = {}
+ module_list = sale_config.MODULE_LIST
+ defaults.update(self.get_installed_modules(cr, uid, module_list, context=context))
+ defaults.update(self.get_applied_groups(cr, uid, context=context))
+
+ for val in ir_values_obj.get(cr, uid, 'default', False, ['sale.order']):
+ defaults.update({val[1]: val[2]})
+ for k in defaults.keys():
+ if k in ['project_timesheet','project_mrp']:
+ defaults.update({'task_work': True})
+ prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
+ uom_id = self.pool.get('product.product').browse(cr, uid, prod_id).uom_id.id
+ defaults.update({'time_unit': uom_id})
+ if k in ['account_analytic_analysis']:
+ defaults.update({'timesheet': True})
+ prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
+ uom_id = self.pool.get('product.product').browse(cr, uid, prod_id).uom_id.id
+ defaults.update({'time_unit': uom_id})
+ if k == 'delivery':
+ defaults.update({'sale_orders': True, 'deli_orders': True, 'charge_delivery': True})
+ if k == 'picking_policy' and defaults[k]=='one':
+ defaults.update({'picking_policy': True})
+ if k == 'order_policy':
+ defaults.update({'order_policy': defaults.get('order_policy')})
+ if k == 'tax_policy' and defaults[k] == ['global_on_order','on_order_line']:
+ ref_tax_ids = obj_tax_temp.search(cr, uid, [('type_tax_use','in', ('sale','all'))], context=context, order="sequence, id desc", limit=1)
+ res.update({'tax_value_id': ref_tax_ids and ref_tax_ids[0] or False})
+ else:
+ res.update({k: False})
+ res.update(defaults)
+ return res
+
_defaults = {
'order_policy': 'manual',
+ 'tax_policy': 'global_on_order',
'time_unit': lambda self, cr, uid, c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c) and self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c)[0] or False,
}
- def onchange_order(self, cr, uid, ids, sale, deli, context=None):
- res = {}
- if sale:
- res.update({'order_policy': 'manual'})
- elif deli:
- res.update({'order_policy': 'picking'})
- return {'value':res}
+ #TODO: Need to check
+# def onchange_order(self, cr, uid, ids, sale, deli, context=None):
+# res = {}
+# if sale:
+# res.update({'order_policy': 'manual'})
+# elif deli:
+# res.update({'order_policy': 'picking'})
+# return {'value':res}
- def execute(self, cr, uid, ids, context=None):
+ def apply_groups(self, cr, uid, ids, group_name, apply=True, context=None):
+ data_obj = self.pool.get('ir.model.data')
+ users_obj = self.pool.get('res.users')
+ groups_obj = self.pool.get('res.groups')
+ dummy,group_id = data_obj.get_object_reference(cr, uid, 'base', group_name)
+ dummy,user_group_id = data_obj.get_object_reference(cr, uid, 'base', 'group_user')
+ if apply:
+ groups_obj.write(cr, uid, [user_group_id], {'implied_ids': [(4,group_id)]})
+ users_obj.write(cr, uid, [uid], {'groups_id': [(4,group_id)]})
+ else:
+ groups_obj.write(cr, uid, [user_group_id], {'implied_ids': [(3,group_id)]})
+ users_obj.write(cr, uid, [uid], {'groups_id': [(3,group_id)]})
+
+ def execute(self, cr, uid, ids, vals, context=None):
+ #TODO: TO BE IMPLEMENTED
ir_values_obj = self.pool.get('ir.values')
data_obj = self.pool.get('ir.model.data')
menu_obj = self.pool.get('ir.ui.menu')
module_obj = self.pool.get('ir.module.module')
- module_upgrade_obj = self.pool.get('base.module.upgrade')
+ users_obj = self.pool.get('res.users')
+ groups_obj = self.pool.get('res.groups')
+
module_name = []
group_id = data_obj.get_object(cr, uid, 'base', 'group_sale_salesman').id
@@ -1380,37 +1460,63 @@ class sale_config_picking_policy(osv.osv_memory):
menu_id = data_obj.get_object(cr, uid, 'sale', 'menu_action_picking_list_to_invoice').id
menu_obj.write(cr, uid, menu_id, {'groups_id':[(4,group_id)]})
+ if wizard.group_sale_pricelist_per_customer:
+ self.apply_groups(cr, uid, ids, 'group_sale_pricelist_per_customer', context=context)
+ else:
+ self.apply_groups(cr, uid, ids, 'group_sale_pricelist_per_customer', False, context=context)
+
+ if wizard.group_sale_uom_per_product:
+ self.apply_groups(cr, uid, ids, 'group_sale_uom_per_product', context=context)
+ else:
+ self.apply_groups(cr, uid, ids, 'group_sale_uom_per_product', False, context=context)
+
+ if wizard.group_sale_delivery_address:
+ self.apply_groups(cr, uid, ids, 'group_sale_delivery_address', context=context)
+ else:
+ self.apply_groups(cr, uid, ids, 'group_sale_delivery_address', False, context=context)
+
+ if wizard.group_sale_disc_per_sale_order_line:
+ self.apply_groups(cr, uid, ids, 'group_sale_disc_per_sale_order_line', context=context)
+ else:
+ self.apply_groups(cr, uid, ids, 'group_sale_disc_per_sale_order_line', False, context=context)
+
if wizard.task_work:
- module_name.append('project_timesheet')
- module_name.append('project_mrp')
- module_name.append('account_analytic_analysis')
+ vals['project_timesheet'] = True
+ vals['project_mrp'] = True
+ vals['account_analytic_analysis'] = True
+ else:
+ vals['project_timesheet'] = False
+ vals['project_mrp'] = False
+ vals['account_analytic_analysis'] = False
if wizard.timesheet:
- module_name.append('account_analytic_analysis')
+ vals['account_analytic_analysis'] = True
+ else:
+ vals['account_analytic_analysis'] = False
if wizard.charge_delivery:
- module_name.append('delivery')
+ vals['delivery'] = True
+ else:
+ vals['delivery'] = False
- if len(module_name):
- module_ids = []
- need_install = False
- module_ids = []
- for module in module_name:
- data_id = module_obj.name_search(cr, uid , module, [], '=')
- module_ids.append(data_id[0][0])
+ if wizard.warning:
+ vals['warning'] = True
+ else:
+ vals['warning'] = False
- for module in module_obj.browse(cr, uid, module_ids):
- if module.state == 'uninstalled':
- module_obj.state_update(cr, uid, [module.id], 'to install', ['uninstalled'], context)
- need_install = True
- cr.commit()
- if need_install:
- pooler.restart_pool(cr.dbname, update_module=True)[1]
+ if wizard.sale_layout:
+ vals['sale_layout'] = True
+ else:
+ vals['sale_layout'] = False
+
+
+ if wizard.picking_policy:
+ ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], 'one')
if wizard.time_unit:
prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
product_obj = self.pool.get('product.product')
- product_obj.write(cr, uid, prod_id, {'uom_id':wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
+ product_obj.write(cr, uid, prod_id, {'uom_id': wizard.time_unit.id, 'uom_po_id': wizard.time_unit.id})
ir_values_obj.set(cr, uid, 'default', False, 'order_policy', ['sale.order'], wizard.order_policy)
if wizard.task_work and wizard.time_unit:
@@ -1419,6 +1525,8 @@ class sale_config_picking_policy(osv.osv_memory):
'project_time_mode_id': wizard.time_unit.id
}, context=context)
-sale_config_picking_policy()
+ super(sale_configuration, self).execute(cr, uid, ids, vals, context=context)
+
+sale_configuration()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 90d3838f5a0..05c02bb208b 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -8,6 +8,8 @@
parent="base.menu_base_partner" sequence="1"
/>
+
+
@@ -21,7 +23,7 @@
-
+
@@ -34,7 +36,7 @@
-
+
@@ -117,9 +119,9 @@
-
-
-
+
+
+
@@ -139,7 +141,7 @@
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, context)"/>
+ nolabel="1" groups="base.group_sale_uom_per_product"/>
@@ -149,9 +151,9 @@
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}" on_change="product_packaging_change(parent.pricelist_id, product_id, product_uom_qty, product_uom, parent.partner_id, product_packaging, True, context)"
domain="[('product_id','=',product_id)]" groups="base.group_extended"
colspan="3"/>
-
-
-
+
+
+
@@ -183,12 +185,12 @@
-
+
-
+
-
+
@@ -240,8 +242,8 @@
-
-
+
+
@@ -361,9 +363,9 @@
-
+
-
+
@@ -382,7 +384,7 @@
-
+
@@ -390,11 +392,11 @@
-
-
+
+
-
-
+
+
@@ -501,67 +503,71 @@
-
+
-
- Setup Your Invoicing Method
- sale.config.picking_policy
+
+ Configure Sales Application
+ sale.configuration
form
-
+
-
-
-
-
- Setup your Invoicing Method
-
-
- This tool will help you to install the right module and configure the system according to the method you use to invoice your customers.
-
-
-
- 12
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Setup your Invoicing Method
- ir.actions.act_window
- sale.config.picking_policy
-
- form
- form
- new
-
-
-
-
-
-
- once
-
-
diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml
index ae8c8bf62e3..9435c449387 100644
--- a/addons/sale/security/sale_security.xml
+++ b/addons/sale/security/sale_security.xml
@@ -20,6 +20,40 @@
+
+ Sales Pricelists
+
+
+
+
+ Product UOM
+
+
+
+
+ Addresses in Sale Orders
+
+
+
+
+ Discount on lines
+
+
+
+
+ Sales Taxes Global/on line
+
+
+
+
+
+
+
diff --git a/addons/sale/test/edi_sale_order.yml b/addons/sale/test/edi_sale_order.yml
index 9a207d9f44e..c53ff9cfc45 100644
--- a/addons/sale/test/edi_sale_order.yml
+++ b/addons/sale/test/edi_sale_order.yml
@@ -57,52 +57,52 @@
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.some_address",
"__module": "base",
"__model": "res.partner.address",
- "phone": "(+32).81.81.37.00",
- "street": "Chaussee de Namur 40",
- "city": "Gerompont",
- "zip": "1367",
+ "phone": "(+32).81.81.37.00",
+ "street": "Chaussee de Namur 40",
+ "city": "Gerompont",
+ "zip": "1367",
"country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
"bank_ids": [
["base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_bank-adaWadsadasdDJzGbp","Ladies bank: 032465789-156113"]
],
- },
- "partner_id": ["purchase:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_test20", "jones white"],
+ },
+ "partner_id": ["purchase:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_test20", "jones white"],
"partner_address": {
"__id": "base:5af1272e-dd26-11e0-b65e-701a04e25543.res_partner_address_7wdsjasdjh",
"__module": "base",
"__model": "res.partner.address",
- "phone": "(+32).81.81.37.00",
- "street": "Chaussee de Namur 40",
- "city": "Gerompont",
- "zip": "1367",
- "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
+ "phone": "(+32).81.81.37.00",
+ "street": "Chaussee de Namur 40",
+ "city": "Gerompont",
+ "zip": "1367",
+ "country_id": ["base:5af1272e-dd26-11e0-b65e-701a04e25543.be", "Belgium"],
},
"order_line": [{
- "__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-AlhsVDZGoKvJ",
- "__module": "purchase",
+ "__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-AlhsVDZGoKvJ",
+ "__module": "purchase",
"__model": "purchase.order.line",
- "__import_module": "sale",
- "__import_model": "sale.order.line",
- "name": "Basic PC",
- "date_planned": "2011-09-30",
- "price_unit": 150.0,
+ "__import_module": "sale",
+ "__import_model": "sale.order.line",
+ "name": "Basic PC",
+ "date_planned": "2011-09-30",
+ "price_unit": 150.0,
"product_id": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_product_pc1", "[PC1] Basic PC"],
- "product_qty": 1.0,
- "product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "PCE"],
+ "product_qty": 1.0,
+ "product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "Unit"],
},
{
- "__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-Alsads33e",
- "__module": "purchase",
+ "__id": "purchase:5af1272e-dd26-11e0-b65e-701a04e25543.purchase_order_line-Alsads33e",
+ "__module": "purchase",
"__model": "purchase.order.line",
- "__import_module": "sale",
+ "__import_module": "sale",
"__import_model": "sale.order.line",
- "name": "Medium PC",
- "date_planned": "2011-09-15",
- "price_unit": 100.0,
+ "name": "Medium PC",
+ "date_planned": "2011-09-15",
+ "price_unit": 100.0,
"product_id": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_product_pc3", "[PC3] Medium PC"],
- "product_qty": 2.0,
- "product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "PCE"],
- }],
+ "product_qty": 2.0,
+ "product_uom": ["product:5af1272e-dd26-11e0-b65e-701a04e25543.product_uom_unit", "Unit"],
+ }],
}
new_sale_order_id = sale_order_pool.edi_import(cr, uid, edi_document, context=context)
assert new_sale_order_id, 'Sale order import failed'
@@ -120,12 +120,12 @@
for sale_line in order_new.order_line:
if sale_line.name == 'Basic PC':
assert sale_line.delay == 18 , "incorrect delay: got %s, expected 18"%(sale_line.delay,)
- assert sale_line.product_uom.name == "PCE" , "uom is not same"
+ assert sale_line.product_uom.name == "Unit" , "uom is not same"
assert sale_line.price_unit == 150 , "unit price is not same, got %s, expected 150"%(sale_line.price_unit,)
assert sale_line.product_uom_qty == 1 , "product qty is not same"
elif sale_line.name == 'Medium PC':
assert sale_line.delay == 3 , "incorrect delay: got %s, expected 3"%(sale_line.delay,)
- assert sale_line.product_uom.name == "PCE" , "uom is not same"
+ assert sale_line.product_uom.name == "Unit" , "uom is not same"
assert sale_line.price_unit == 100 , "unit price is not same, got %s, expected 100"%(sale_line.price_unit,)
assert sale_line.product_uom_qty == 2 , "product qty is not same"
else:
diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml
index d997e792696..dcbc4ebc56b 100644
--- a/addons/sale/test/manual_order_policy.yml
+++ b/addons/sale/test/manual_order_policy.yml
@@ -82,8 +82,8 @@
-
I set order policy "Deliver & invoice on demand" as default policy.
-
- !record {model: sale.config.picking_policy, id: sale.config.picking_policy_0}:
+ !record {model: sale.configuration, id: sale_configuration_0}:
order_policy: 'manual'
-
- !python {model: sale.config.picking_policy}: |
- self.execute(cr, uid, [ref("sale.config.picking_policy_0")])
+ !python {model: sale.configuration}: |
+ self.execute(cr, uid, [ref("sale_configuration_0")], {})