diff --git a/addons/portal_sale/security/ir.model.access.csv b/addons/portal_sale/security/ir.model.access.csv index c73be67e8c9..37e27c54d36 100644 --- a/addons/portal_sale/security/ir.model.access.csv +++ b/addons/portal_sale/security/ir.model.access.csv @@ -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 diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index a20ba01f300..5d057489253 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -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, diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index 8f725a9eacb..69e9cc5e119 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -13,7 +13,6 @@ - @@ -58,7 +57,6 @@ - @@ -70,7 +68,6 @@ - diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 66653c61849..fe7c8752078 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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'], } diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml index 6d7cd043c39..8a6b1a8cbe3 100644 --- a/addons/sale/sale_data.xml +++ b/addons/sale/sale_data.xml @@ -19,20 +19,6 @@ sale.order - - - - - - - - - - - - mail.group diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml index 428b586ffa8..3a0fe8b3bc5 100644 --- a/addons/sale/sale_demo.xml +++ b/addons/sale/sale_demo.xml @@ -6,7 +6,6 @@ - @@ -45,7 +44,6 @@ - manual @@ -75,7 +73,6 @@ - manual @@ -105,7 +102,6 @@ - @@ -154,7 +150,6 @@ - @@ -193,7 +188,6 @@ - @@ -261,7 +255,6 @@ - manual diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml index 18a59320d9c..8d7d54d9640 100644 --- a/addons/sale/sale_unit_test.xml +++ b/addons/sale/sale_unit_test.xml @@ -3,7 +3,6 @@ - diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 18fdb739923..cd82d99c546 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -13,59 +13,6 @@ - - - sale.shop - sale.shop - - - - - - - - - - - - - - - - - - - - sale.shop - sale.shop - - - - - - - - - - - Shop - ir.actions.act_window - sale.shop - form - tree,form - - - - Click to define a new sale shop. - - 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. - - - - - sale.order.calendar sale.order @@ -160,7 +107,6 @@ - @@ -178,13 +124,13 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - - Sale Shop multi-company - - - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] - -
- Click to define a new sale shop. -
- 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. -