[IMP]remove total sale.shop from sales
bzr revid: sgo@tinyerp.com-20130121100542-36qmkrd82md97phv
This commit is contained in:
parent
d931634596
commit
cf6595baf2
|
@ -11,7 +11,6 @@ access_account_move,account.move,account.model_account_move,portal.group_portal,
|
|||
access_account_move_line,account.move.line,account.model_account_move_line,portal.group_portal,1,0,0,0
|
||||
access_account_move_reconcile,account.move.reconcile,account.model_account_move_reconcile,portal.group_portal,1,0,0,0
|
||||
access_account_fiscalyear,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,portal.group_portal,1,0,0,0
|
||||
access_sale_shop,sale.shop,sale.model_sale_shop,portal.group_portal,1,0,0,0
|
||||
access_product_list,product.pricelist,product.model_product_pricelist,portal.group_portal,1,0,0,0
|
||||
access_res_partner,res.partner,base.model_res_partner,portal.group_portal,1,0,0,0
|
||||
access_account_tax,account.tax,account.model_account_tax,portal.group_portal,1,0,0,0
|
||||
|
|
|
|
@ -40,7 +40,6 @@ class sale_report(osv.osv):
|
|||
'product_uom_qty': fields.float('# of Qty', readonly=True),
|
||||
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'shop_id': fields.many2one('sale.shop', 'Shop', readonly=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', readonly=True),
|
||||
'user_id': fields.many2one('res.users', 'Salesperson', readonly=True),
|
||||
'price_total': fields.float('Total Price', readonly=True),
|
||||
|
@ -79,7 +78,6 @@ class sale_report(osv.osv):
|
|||
to_char(s.date_order, 'YYYY-MM-DD') as day,
|
||||
s.partner_id as partner_id,
|
||||
s.user_id as user_id,
|
||||
s.shop_id as shop_id,
|
||||
s.company_id as company_id,
|
||||
extract(epoch from avg(date_trunc('day',s.date_confirm)-date_trunc('day',s.create_date)))/(24*60*60)::decimal(16,2) as delay,
|
||||
s.state,
|
||||
|
@ -104,7 +102,6 @@ class sale_report(osv.osv):
|
|||
s.date_confirm,
|
||||
s.partner_id,
|
||||
s.user_id,
|
||||
s.shop_id,
|
||||
s.company_id,
|
||||
s.state,
|
||||
s.pricelist_id,
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<field name="year" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="shop_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1" groups="base.group_multi_company"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
|
@ -58,7 +57,6 @@
|
|||
<field name="product_id"/>
|
||||
<field name="user_id"/>
|
||||
<group expand="0" string="Extended Filters...">
|
||||
<field name="shop_id"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
|
@ -70,7 +68,6 @@
|
|||
<filter string="Category of Product" icon="terp-stock_symbol-selection" name="Category" context="{'group_by':'categ_id'}"/>
|
||||
<filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'analytic_account_id'}" groups="analytic.group_analytic_accounting"/>
|
||||
<filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<filter string="Shop" icon="terp-go-home" context="{'group_by':'shop_id'}"/>
|
||||
<filter string="Company" icon="terp-go-home" groups="base.group_multi_company" context="{'group_by':'company_id'}"/>
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Ordered date of the sales order"/>
|
||||
<filter string="Month" name="order_month" icon="terp-go-month" context="{'group_by':'month'}" help="Ordered month of the sales order"/>
|
||||
|
|
|
@ -29,22 +29,6 @@ from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FO
|
|||
import openerp.addons.decimal_precision as dp
|
||||
from openerp import netsvc
|
||||
|
||||
class sale_shop(osv.osv):
|
||||
_name = "sale.shop"
|
||||
_description = "Sales Shop"
|
||||
_columns = {
|
||||
'name': fields.char('Shop Name', size=64, required=True),
|
||||
'payment_default_id': fields.many2one('account.payment.term', 'Default Payment Term', required=True),
|
||||
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist'),
|
||||
'project_id': fields.many2one('account.analytic.account', 'Analytic Account', domain=[('parent_id', '!=', False)]),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=False),
|
||||
}
|
||||
_defaults = {
|
||||
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.shop', context=c),
|
||||
}
|
||||
|
||||
sale_shop()
|
||||
|
||||
class sale_order(osv.osv):
|
||||
_name = "sale.order"
|
||||
_inherit = ['mail.thread', 'ir.needaction_mixin']
|
||||
|
@ -56,16 +40,6 @@ class sale_order(osv.osv):
|
|||
},
|
||||
}
|
||||
|
||||
def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
|
||||
v = {}
|
||||
if shop_id:
|
||||
shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context)
|
||||
if shop.project_id.id:
|
||||
v['project_id'] = shop.project_id.id
|
||||
if shop.pricelist_id.id:
|
||||
v['pricelist_id'] = shop.pricelist_id.id
|
||||
return {'value': v}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
|
@ -178,17 +152,9 @@ class sale_order(osv.osv):
|
|||
result[line.order_id.id] = True
|
||||
return result.keys()
|
||||
|
||||
def _get_default_shop(self, cr, uid, context=None):
|
||||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
shop_ids = self.pool.get('sale.shop').search(cr, uid, [('company_id','=',company_id)], context=context)
|
||||
if not shop_ids:
|
||||
raise osv.except_osv(_('Error!'), _('There is no default shop for the current user\'s company!'))
|
||||
return shop_ids[0]
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Order Reference', size=64, required=True,
|
||||
readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True),
|
||||
'shop_id': fields.many2one('sale.shop', 'Shop', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
|
||||
'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this sales order request."),
|
||||
'client_order_ref': fields.char('Customer Reference', size=64),
|
||||
'state': fields.selection([
|
||||
|
@ -249,7 +215,7 @@ class sale_order(osv.osv):
|
|||
'invoice_quantity': fields.selection([('order', 'Ordered Quantities')], 'Invoice on', help="The sales order will automatically create the invoice proposition (draft invoice).", required=True, readonly=True, states={'draft': [('readonly', False)]}),
|
||||
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
|
||||
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
|
||||
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True,readonly=True)
|
||||
'company_id': fields.many2one('res.company','Company')
|
||||
}
|
||||
_defaults = {
|
||||
'date_order': fields.date.context_today,
|
||||
|
@ -258,7 +224,6 @@ class sale_order(osv.osv):
|
|||
'user_id': lambda obj, cr, uid, context: uid,
|
||||
'name': lambda obj, cr, uid, context: '/',
|
||||
'invoice_quantity': 'order',
|
||||
'shop_id': _get_default_shop,
|
||||
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
|
||||
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
|
||||
}
|
||||
|
|
|
@ -19,20 +19,6 @@
|
|||
<field name="object">sale.order</field>
|
||||
</record>
|
||||
|
||||
<!-- Resource: sale.shop -->
|
||||
<record id="sale_shop_1" model="sale.shop">
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="payment_default_id" ref="account.account_payment_term_net"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
|
||||
<!-- Copy the name of any company. Without demo data this will yield
|
||||
the main company name, which is correct. With demo data it will
|
||||
be random, but it does not matter much -->
|
||||
<field model="res.company" name="name" search="[]" use="name"/>
|
||||
</record>
|
||||
|
||||
<function eval="('default',False,'shop_id', [('sale.order', False)], sale_shop_1, True, False, False, False, True)" id="sale_default_set" model="ir.values" name="set"/>
|
||||
|
||||
<!-- notify all employees of module installation -->
|
||||
<record model="mail.message" id="module_install_notification">
|
||||
<field name="model">mail.group</field>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_2"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_2"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_2"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
</record>
|
||||
|
@ -45,7 +44,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_7"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_13"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_address_13"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
<field name="order_policy">manual</field>
|
||||
|
@ -75,7 +73,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_14"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_14"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_14"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
<field name="order_policy">manual</field>
|
||||
|
@ -105,7 +102,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_15"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_25"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_address_25"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
</record>
|
||||
|
@ -154,7 +150,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_2"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_2"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_2"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
</record>
|
||||
|
@ -193,7 +188,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_18"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_18"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_18"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
</record>
|
||||
|
@ -261,7 +255,6 @@
|
|||
<field name="partner_id" ref="base.res_partner_15"/>
|
||||
<field name="partner_invoice_id" ref="base.res_partner_address_25"/>
|
||||
<field name="partner_shipping_id" ref="base.res_partner_address_25"/>
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
<field name="pricelist_id" ref="product.list0"/>
|
||||
<field name="order_policy">manual</field>
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<data>
|
||||
<!-- Resource: sale.order -->
|
||||
<record id="test_order_1" model="sale.order">
|
||||
<field name="shop_id" ref="sale_shop_1"/>
|
||||
<field model="product.pricelist" name="pricelist_id" search="[]"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field model="res.partner" name="partner_id" search="[]"/>
|
||||
|
|
|
@ -13,59 +13,6 @@
|
|||
|
||||
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
|
||||
|
||||
|
||||
<record id="view_shop_form" model="ir.ui.view">
|
||||
<field name="name">sale.shop</field>
|
||||
<field name="model">sale.shop</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Sales Shop" version="7.0">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name"/></h1>
|
||||
<group name="shop">
|
||||
<group>
|
||||
<field name="payment_default_id"/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="project_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_shop_tree" model="ir.ui.view">
|
||||
<field name="name">sale.shop</field>
|
||||
<field name="model">sale.shop</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Sales Shop">
|
||||
<field name="name"/>
|
||||
<field name="pricelist_id" groups="product.group_sale_pricelist"/>
|
||||
<field name="project_id" groups="analytic.group_analytic_accounting"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_shop_form" model="ir.actions.act_window">
|
||||
<field name="name">Shop</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">sale.shop</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_shop_tree"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to define a new sale shop.
|
||||
</p><p>
|
||||
Each quotation or sales order must be linked to a shop. The
|
||||
shop also defines the warehouse from which the products will be
|
||||
delivered for each particular sales.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_sale_order_calendar" model="ir.ui.view">
|
||||
<field name="name">sale.order.calendar</field>
|
||||
<field name="model">sale.order</field>
|
||||
|
@ -160,7 +107,6 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="date_order"/>
|
||||
<field name="shop_id" groups="base.group_no_one" on_change="onchange_shop_id(shop_id, context)" widget="selection"/>
|
||||
<field name="client_order_ref"/>
|
||||
<field domain="[('type','=','sale')]" name="pricelist_id" groups="product.group_sale_pricelist" on_change="onchange_pricelist_id(pricelist_id,order_line)"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
|
@ -178,13 +124,13 @@
|
|||
<group>
|
||||
<field name="state" invisible="1" />
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
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, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
|
||||
<label for="product_uom_qty"/>
|
||||
<div>
|
||||
<field
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
name="product_uom_qty" class="oe_inline"
|
||||
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, False, parent.fiscal_position, True, context)"/>
|
||||
<field name="product_uom" groups="product.group_uom" class="oe_inline oe_no_button"
|
||||
|
@ -222,12 +168,12 @@
|
|||
<field name="state" invisible="1"/>
|
||||
<field name="th_weight" invisible="1"/>
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
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, True, parent.date_order, False, parent.fiscal_position, False, context)"/>
|
||||
<field name="name"/>
|
||||
<field name="product_uom_qty"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'shop':parent.shop_id, 'uom':product_uom}"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
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, False, 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)"
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_sale_shop,sale.shop,model_sale_shop,base.group_user,1,0,0,0
|
||||
access_sale_order,sale.order,model_sale_order,base.group_sale_salesman,1,1,1,0
|
||||
access_sale_order_line,sale.order.line,model_sale_order_line,base.group_sale_salesman,1,1,1,1
|
||||
access_sale_order_line_accountant,sale.order.line accountant,model_sale_order_line,account.group_account_user,1,1,0,0
|
||||
|
@ -19,7 +18,6 @@ access_res_partner_sale_user,res.partner.sale.user,base.model_res_partner,base.g
|
|||
access_res_partner_sale_manager,res.partner.sale.manager,base.model_res_partner,base.group_sale_manager,1,1,1,0
|
||||
access_product_template_sale_user,product.template sale use,product.model_product_template,base.group_sale_salesman,1,0,0,0
|
||||
access_product_product_sale_user,product.product sale use,product.model_product_product,base.group_sale_salesman,1,0,0,0
|
||||
access_sale_shop_manager,account.journal sale order.user,model_sale_shop,base.group_sale_manager,1,1,1,1
|
||||
access_account_fiscalyear_user,account.fiscalyear.user,account.model_account_fiscalyear,base.group_sale_salesman,1,0,0,0
|
||||
access_account_tax_user,account.tax.user,account.model_account_tax,base.group_sale_salesman,1,0,0,0
|
||||
access_ir_attachment_sales,ir.attachment.sales,base.model_ir_attachment,base.group_sale_salesman,1,1,1,0
|
||||
|
@ -29,8 +27,6 @@ access_res_partner_bank_type_field_user,res.partner.bank.type.field.user,base.mo
|
|||
access_product_uom_user,product.uom.user,product.model_product_uom,base.group_sale_salesman,1,0,0,0
|
||||
access_product_pricelist_sale_user,product.pricelist.sale.user,product.model_product_pricelist,base.group_sale_salesman,1,0,0,0
|
||||
access_account_account_salesman,account_account salesman,account.model_account_account,base.group_sale_salesman,1,0,0,0
|
||||
access_sale_shop_sale_user,sale.shop.sale.user,model_sale_shop,base.group_sale_salesman,1,0,0,0
|
||||
access_sale_shop_sale_manager,sale.shop.sale.manager,model_sale_shop,base.group_sale_manager,1,1,1,1
|
||||
access_product_uom_categ_sale_manager,product.uom.categ salemanager,product.model_product_uom_categ,base.group_sale_manager,1,1,1,1
|
||||
access_product_uom_sale_manager,product.uom salemanager,product.model_product_uom,base.group_sale_manager,1,1,1,1
|
||||
access_product_ul_sale_manager,product.ul salemanager,product.model_product_ul,base.group_sale_manager,1,1,1,1
|
||||
|
|
|
|
@ -78,13 +78,6 @@
|
|||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="sale_shop_comp_rule">
|
||||
<field name="name">Sale Shop multi-company</field>
|
||||
<field name="model_id" ref="model_sale_shop"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<!-- Multi - Salesmen sales order assignation rules -->
|
||||
|
||||
<record id="sale_order_personal_rule" model="ir.rule">
|
||||
|
|
Loading…
Reference in New Issue