[MERGE]: Merged with lp:~openerp-dev/openobject-addons/trunk-v62_sale-tpa
bzr revid: uco@tinyerp.com-20120229072907-3nkv46cxzj9j0pf4
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -54,13 +54,13 @@
|
||||
<field name="name">Accounting</field>
|
||||
<field name="sequence">5</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="account_configuration_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_account_configuration_installer"/>
|
||||
<field name="category_id" ref="category_accounting_configuration"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="type">automatic</field>
|
||||
</record>
|
||||
<field name="action_id" ref="action_account_configuration_installer"/>
|
||||
<field name="category_id" ref="category_accounting_configuration"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="type">automatic</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_financial_accounts_installer" model="ir.actions.act_window">
|
||||
<field name="name">Review your Financial Accounts</field>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
<data>
|
||||
|
||||
<!--
|
||||
Analytic Account form
|
||||
Analytic Account form
|
||||
|
||||
Remove information on Account data => because they move on analysis sheet
|
||||
create a page with invoicing informations
|
||||
-->
|
||||
<record id="account_analytic_account_invoice_stat_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.invoice.stat.form.inherit</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">account.analytic.account.invoice.stat.form.inherit</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="hr_timesheet_invoice.account_analytic_account_form_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
@@ -30,9 +30,9 @@
|
||||
</record>
|
||||
|
||||
<record id="hr_timesheet.account_analytic_account_form_form" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.invoice.form.inherit</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">account.analytic.account.invoice.form.inherit</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_account_form"/>
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
@@ -69,7 +69,7 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Stats by user">
|
||||
<page string="Stats by user">
|
||||
<field colspan="4" name="user_ids" nolabel="1">
|
||||
<tree string="Users">
|
||||
<field name="user"/>
|
||||
@@ -97,19 +97,35 @@
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.tree</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
|
||||
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
|
||||
<field name="name">account.analytic.account.tree</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_analytic_account_list"/>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="before">
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="before">
|
||||
<field name="last_invoice_date"/>
|
||||
<field name="ca_to_invoice"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_contract_installation" model="ir.ui.view">
|
||||
<field name="name">Sales Application</field>
|
||||
<field name="model">sale.configuration</field>
|
||||
<field name="inherit_id" ref="base.view_config_picking_policy"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_analytic_analysis" position="after">
|
||||
<newline/>
|
||||
<field name="analytic_user_function"/>
|
||||
<newline/>
|
||||
<field name="analytic_journal_billing_rate"/>
|
||||
<newline/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
+18
-18
@@ -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:
|
||||
|
||||
@@ -337,7 +337,7 @@
|
||||
<field name="sequence">10</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="define_delivery_steps_form">
|
||||
<!--record model="ir.ui.view" id="define_delivery_steps_form">
|
||||
<field name="name">delivery.define_delivery_steps</field>
|
||||
<field name="model">delivery.define.delivery.steps.wizard</field>
|
||||
<field name="type">form</field>
|
||||
@@ -366,6 +366,6 @@
|
||||
<field name="action_id" ref="action_define_delivery_steps" />
|
||||
<field name="category_id" ref="base.category_sales_management_config"/>
|
||||
<field name="type">once</field>
|
||||
</record>
|
||||
</record-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -48,11 +48,16 @@
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="outlook_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_outlook_installer"/>
|
||||
<field name="category_id" ref="base.category_sales_management_config"/>
|
||||
<field name="sequence">4</field>
|
||||
<field name="type">automatic</field>
|
||||
<record id="view_config_outlook_installer" model="ir.ui.view">
|
||||
<field name="name">Sales Application</field>
|
||||
<field name="model">sale.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_config_picking_policy"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="plugin_outlook" position="after">
|
||||
<button name="%(action_outlook_installer)d" type="action" string="Configure Outlook Plug-In" icon="gtk-execute" colspan="2"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_outlook_wizard" model="ir.actions.act_window">
|
||||
|
||||
@@ -54,11 +54,17 @@
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<record id="thunderbird_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_thunderbird_installer"/>
|
||||
<field name="category_id" ref="base.category_sales_management_config"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="type">automatic</field>
|
||||
|
||||
<record id="view_config_thunderbird_installer" model="ir.ui.view">
|
||||
<field name="name">Sales Application</field>
|
||||
<field name="model">sale.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.view_config_picking_policy"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="plugin_thunderbird" position="after">
|
||||
<button name="%(action_thunderbird_installer)d" type="action" string="Configure Thunderbird Plug-In" icon="gtk-execute" colspan="2"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="base.menu_base_config_plugins" name="Plugins" parent="base.menu_base_config" sequence="10"/>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<page string="Sales & Purchases" position="inside">
|
||||
<newline/>
|
||||
<group col="2" colspan="2" groups="base.group_extended">
|
||||
<group col="2" colspan="2" groups="base.group_sale_pricelist_per_customer">
|
||||
<separator string="Sales Properties" colspan="2"/>
|
||||
<field name="property_product_pricelist"/>
|
||||
</group>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<menuitem id="base.menu_sale_config_sales" name="Sales"
|
||||
parent="base.menu_base_config" sequence="0" groups="base.group_extended"/>
|
||||
<menuitem groups="base.group_extended" id="menu_product_pricelist_main" name="Pricelists" parent="base.menu_base_config" sequence="50"/>
|
||||
<menuitem id="menu_product_pricelist_main" name="Pricelists" parent="base.menu_base_config" sequence="50"/>
|
||||
|
||||
<record id="product_pricelist_version_form_view" model="ir.ui.view">
|
||||
<field name="name">product.pricelist.version.form</field>
|
||||
@@ -195,7 +195,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="product_price_type_action" model="ir.actions.act_window">
|
||||
<field name="name">Price Types</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
-->
|
||||
<record id="product_uom_unit" model="product.uom">
|
||||
<field name="category_id" ref="product_uom_categ_unit"/>
|
||||
<field name="name">PCE</field>
|
||||
<field name="name">Unit</field>
|
||||
<field name="factor" eval="1.0"/>
|
||||
<field name="rounding" eval="1.0"/>
|
||||
</record>
|
||||
|
||||
+144
-36
@@ -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:
|
||||
|
||||
+82
-76
@@ -8,6 +8,8 @@
|
||||
parent="base.menu_base_partner" sequence="1"
|
||||
/>
|
||||
|
||||
<menuitem groups="base.group_sale_pricelist_per_customer" id="product.menu_product_pricelist_main" name="Pricelists" parent="base.menu_base_config"/>
|
||||
|
||||
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
|
||||
|
||||
<record id="view_shop_form" model="ir.ui.view">
|
||||
@@ -21,7 +23,7 @@
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<separator colspan="4" string="Accounting"/>
|
||||
<field name="payment_default_id"/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" select="1"/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_sale_pricelist_per_customer" select="1"/>
|
||||
<field name="project_id" select="1" groups="analytic.group_analytic_accounting"/>
|
||||
</form>
|
||||
</field>
|
||||
@@ -34,7 +36,7 @@
|
||||
<tree string="Sales Shop">
|
||||
<field name="name"/>
|
||||
<field name="warehouse_id"/>
|
||||
<field name="pricelist_id"/>
|
||||
<field name="pricelist_id" groups="base.group_sale_pricelist_per_customer"/>
|
||||
<field name="project_id" groups="analytic.group_analytic_accounting"/>
|
||||
</tree>
|
||||
</field>
|
||||
@@ -117,9 +119,9 @@
|
||||
<page string="Sales Order">
|
||||
<field name="partner_id" options='{"quick_create": false}' on_change="onchange_partner_id(partner_id)" domain="[('customer','=',True)]" context="{'search_default_customer':1}" required="1"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="partner_order_id" on_change="onchange_partner_order_id(partner_order_id, partner_invoice_id, partner_shipping_id)" options='{"quick_create": false}'/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" options='{"quick_create": false}'/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" options='{"quick_create": false}'/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_sale_delivery_address" options='{"quick_create": false}'/>
|
||||
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_sale_delivery_address" options='{"quick_create": false}'/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_sale_pricelist_per_customer" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
|
||||
<field name="project_id" context="{'partner_id':partner_id, 'contact_id':partner_order_id, 'pricelist_id':pricelist_id, 'default_name':name}" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
|
||||
<newline/>
|
||||
<field colspan="4" name="order_line" nolabel="1" widget="one2many_list">
|
||||
@@ -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)"/>
|
||||
<field name="product_uom"
|
||||
on_change="product_uom_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, context)"
|
||||
nolabel="1"/>
|
||||
nolabel="1" groups="base.group_sale_uom_per_product"/>
|
||||
<field name="price_unit"/>
|
||||
|
||||
<field groups="product.group_uos" name="product_uos_qty"/>
|
||||
@@ -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"/>
|
||||
<field name="discount"/>
|
||||
<separator colspan="5" string="Notes"/>
|
||||
<field colspan="5" name="notes" nolabel="1"/>
|
||||
<field name="discount" groups="base.group_sale_disc_per_sale_order_line"/>
|
||||
<separator colspan="5" string="Notes" groups="base.group_sale_notes_subtotal"/>
|
||||
<field colspan="5" name="notes" nolabel="1" groups="base.group_sale_notes_subtotal"/>
|
||||
<separator colspan="5" string="Taxes"/>
|
||||
<field colspan="5" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','<>','purchase')]"/>
|
||||
<group colspan="5" col="5" groups="base.group_extended">
|
||||
@@ -183,12 +185,12 @@
|
||||
<tree string="Sales Order Lines">
|
||||
<field colspan="4" name="name"/>
|
||||
<field name="product_uom_qty" string="Qty(UoM)"/>
|
||||
<field name="product_uom" string="UoM"/>
|
||||
<field name="product_uom" string="UoM" groups="base.group_sale_uom_per_product"/>
|
||||
<field groups="product.group_uos" name="product_uos_qty" string="Qty(UoS)"/>
|
||||
<field groups="product.group_uos" name="product_uos" string="UoS"/>
|
||||
<field name="discount"/>
|
||||
<field name="discount" groups="base.group_sale_disc_per_sale_order_line"/>
|
||||
<field name="price_unit"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="price_subtotal" groups="base.group_sale_notes_subtotal"/>
|
||||
</tree>
|
||||
</field>
|
||||
<newline/>
|
||||
@@ -240,8 +242,8 @@
|
||||
<field name="create_date"/>
|
||||
<field name="date_confirm"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="note" nolabel="1"/>
|
||||
<separator colspan="4" string="Notes" groups="base.group_sale_notes_subtotal"/>
|
||||
<field colspan="4" name="note" nolabel="1" groups="base.group_sale_notes_subtotal"/>
|
||||
</page>
|
||||
<page string="History" groups="base.group_extended">
|
||||
<separator colspan="4" string="Invoices"/>
|
||||
@@ -361,9 +363,9 @@
|
||||
<field name="order_partner_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_uom_qty" string="Qty"/>
|
||||
<field name="product_uom" string="UoM"/>
|
||||
<field name="product_uom" string="UoM" groups="base.group_sale_uom_per_product"/>
|
||||
<field name="salesman_id"/>
|
||||
<field name="price_subtotal" sum="Total"/>
|
||||
<field name="price_subtotal" sum="Total" groups="base.group_sale_notes_subtotal"/>
|
||||
<field name="state"/>
|
||||
<field name="invoiced"/>
|
||||
</tree>
|
||||
@@ -382,7 +384,7 @@
|
||||
|
||||
<field name="product_id" readonly="1"/>
|
||||
<field name="product_uom_qty" readonly="1"/>
|
||||
<field name="product_uom"/>
|
||||
<field name="product_uom" groups="base.group_sale_uom_per_product"/>
|
||||
|
||||
<field colspan="4" name="name" groups="base.group_extended"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
@@ -390,11 +392,11 @@
|
||||
<separator colspan="4" string="Price"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="price_unit"/>
|
||||
<field name="discount"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="discount" groups="base.group_sale_disc_per_sale_order_line"/>
|
||||
<field name="price_subtotal" groups="base.group_sale_notes_subtotal"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Notes"/>
|
||||
<field colspan="4" name="notes" nolabel="1"/>
|
||||
<separator colspan="4" string="Notes" groups="base.group_sale_notes_subtotal"/>
|
||||
<field colspan="4" name="notes" nolabel="1" groups="base.group_sale_notes_subtotal"/>
|
||||
<separator colspan="4"/>
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
|
||||
<group col="3" colspan="2">
|
||||
@@ -501,67 +503,71 @@
|
||||
<menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_base_partner" sequence="5" groups="base.group_extended"/>
|
||||
<menuitem id="menu_invoicing_sales_order_lines" parent="base.menu_invoiced" action="action_order_line_tree2" sequence="2" groups="base.group_no_one"/>
|
||||
|
||||
<!-- configartion view -->
|
||||
<!-- Configartion View -->
|
||||
|
||||
<record id="view_config_picking_policy" model="ir.ui.view">
|
||||
<field name="name">Setup Your Invoicing Method</field>
|
||||
<field name="model">sale.config.picking_policy</field>
|
||||
<record id="view_config_picking_policy_sales" model="ir.ui.view">
|
||||
<field name="name">Configure Sales Application</field>
|
||||
<field name="model">sale.configuration</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="inherit_id" ref="base.view_config_picking_policy"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<form position="attributes">
|
||||
<attribute name="string">Setup your Invoicing Method</attribute>
|
||||
</form>
|
||||
|
||||
<xpath expr="//separator[@string="title"]" position="attributes">
|
||||
<attribute name="string">Setup your Invoicing Method</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">This tool will help you to install the right module and configure the system according to the method you use to invoice your customers.</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//separator[@string="vsep"]" position="attributes">
|
||||
<attribute name="string"/>
|
||||
<attribute name="rowspan">12</attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group colspan="4" col="4">
|
||||
<field name="sale_orders" on_change="onchange_order(sale_orders,deli_orders)"/>
|
||||
<newline/>
|
||||
<field name="deli_orders" on_change="onchange_order(sale_orders,deli_orders)"/>
|
||||
<newline/>
|
||||
<field name="task_work"/>
|
||||
<newline/>
|
||||
<field name="timesheet"/>
|
||||
<newline/>
|
||||
<separator string="Options" colspan="4"/>
|
||||
<field name="order_policy" attrs="{'invisible':['|',('sale_orders','!=',True),('deli_orders','!=',True)]}"/>
|
||||
<newline/>
|
||||
<field name="charge_delivery" attrs="{'invisible':[('sale_orders','!=',True), ('deli_orders','!=',True)]}"/>
|
||||
<newline/>
|
||||
<field name="time_unit" widget="selection" domain="[('category_id','=',%(product.uom_categ_wtime)s)]" attrs="{'invisible':[('task_work','=',False),('timesheet','=',False)]}"/>
|
||||
<xpath expr="//form/separator[@string='Contracts']" position="before">
|
||||
<separator string="Picking and Invoice Policy" colspan="4"/>
|
||||
<group colspan="4" col="8">
|
||||
<group colspan="4" col="4">
|
||||
<field name="sale_orders"/>
|
||||
<newline/>
|
||||
<field name="deli_orders"/>
|
||||
<newline/>
|
||||
<field name="task_work"/>
|
||||
<newline/>
|
||||
<field name="timesheet"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<field name="order_policy" attrs="{'invisible':['|',('sale_orders','=',False),('deli_orders','=',False)]}"/>
|
||||
<newline/>
|
||||
<field name="charge_delivery" attrs="{'invisible':[('sale_orders','=',False), ('deli_orders','=',False)]}"/>
|
||||
<newline/>
|
||||
<field name="picking_policy" attrs="{'invisible':[('deli_orders','=',False)]}"/>
|
||||
<newline/>
|
||||
<field name="time_unit" domain="[('category_id.name','=','Working Time')]" attrs="{'invisible':[('task_work','=',False),('timesheet','=',False)],'required': [('timesheet','=',True)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
|
||||
<separator string="Sale Order" colspan="4"/>
|
||||
<group colspan="4" col="8">
|
||||
<group colspan="4" col="4">
|
||||
<field name="group_sale_pricelist_per_customer"/>
|
||||
<newline/>
|
||||
<group colspan="4" col="4">
|
||||
<field name="tax_policy" />
|
||||
<field name="tax_value" nolabel="1" attrs="{'invisible': [('tax_policy','in',['no_tax','global_on_order'])]}"/>
|
||||
<field name="tax_value_id" nolabel="1" attrs="{'invisible': [('tax_policy','in',['no_tax','on_order_line'])]}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="sale_margin"/>
|
||||
<newline/>
|
||||
<field name="warning"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<group colspan="4" col="4">
|
||||
<newline/>
|
||||
<field name="group_sale_uom_per_product"/>
|
||||
<newline/>
|
||||
<field name="group_sale_delivery_address"/>
|
||||
<newline/>
|
||||
<field name="group_sale_disc_per_sale_order_line"/>
|
||||
<newline/>
|
||||
<field name="sale_layout"/>
|
||||
<newline/>
|
||||
<field name="sale_journal"/>
|
||||
<newline/>
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_config_picking_policy" model="ir.actions.act_window">
|
||||
<field name="name">Setup your Invoicing Method</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.config.picking_policy</field>
|
||||
<field name="view_id" ref="view_config_picking_policy"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
<record id="config_wizard_step_sale_picking_policy" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_config_picking_policy"/>
|
||||
<field name="category_id" ref="base.category_sales_management_config"/>
|
||||
<field name="type">once</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -20,6 +20,40 @@
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_pricelist_per_customer" model="res.groups">
|
||||
<field name="name">Sales Pricelists</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_uom_per_product" model="res.groups">
|
||||
<field name="name">Product UOM</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_delivery_address" model="res.groups">
|
||||
<field name="name">Addresses in Sale Orders</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_disc_per_sale_order_line" model="res.groups">
|
||||
<field name="name">Discount on lines</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_sale_taxes_global_or_online" model="res.groups">
|
||||
<field name="name">Sales Taxes Global/on line</field>
|
||||
<field name="category_id" ref="base.module_category_usability"/>
|
||||
</record>
|
||||
|
||||
<record id="base.group_user" model="res.groups">
|
||||
<field name="implied_ids" eval="[(6,0,[ref('base.group_sale_pricelist_per_customer'),
|
||||
ref('base.group_sale_uom_per_product'),
|
||||
ref('base.group_sale_delivery_address'),
|
||||
ref('base.group_sale_disc_per_sale_order_line'),
|
||||
ref('base.group_sale_taxes_global_or_online'),
|
||||
])]"/>
|
||||
</record>
|
||||
|
||||
<record model="res.users" id="base.user_admin">
|
||||
<field eval="[(4,ref('base.group_partner_manager'))]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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")], {})
|
||||
|
||||
Reference in New Issue
Block a user