- Record and track your customers' claims. Claims may be linked to a sales order or a lot.You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).Claims may automatically be linked to an email address using the mail gateway module.
-
+
+ Record and track your customers' claims. Claims may be linked to a sales order or a lot.You can send emails with attachments and keep the full history for a claim (emails sent, intervention type and so on).Claims may automatically be linked to an email address using the mail gateway module.
+
diff --git a/addons/crm_claim/crm_claim_view.xml b/addons/crm_claim/crm_claim_view.xml
index ca28c68ce80..8f3aa91bb15 100644
--- a/addons/crm_claim/crm_claim_view.xml
+++ b/addons/crm_claim/crm_claim_view.xml
@@ -216,35 +216,5 @@
-
-
- res.partner.claim.info.form
- res.partner
-
- 20
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_claim/res_partner_view.xml b/addons/crm_claim/res_partner_view.xml
new file mode 100644
index 00000000000..4a5db879311
--- /dev/null
+++ b/addons/crm_claim/res_partner_view.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ res.partner.claim.info.form
+ res.partner
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/event/res_partner.py b/addons/event/res_partner.py
index fc4afa56e69..b51e1fbb9d3 100644
--- a/addons/event/res_partner.py
+++ b/addons/event/res_partner.py
@@ -21,15 +21,13 @@
from openerp.osv import fields, osv
+
class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'speaker': fields.boolean('Speaker', help="Check this box if this contact is a speaker."),
- 'event_ids': fields.one2many('event.event','main_speaker_id', readonly=True),
- 'event_registration_ids': fields.one2many('event.registration','partner_id', readonly=True),
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/event/res_partner_view.xml b/addons/event/res_partner_view.xml
index c3e8073a7ae..7e97f80e30d 100644
--- a/addons/event/res_partner_view.xml
+++ b/addons/event/res_partner_view.xml
@@ -2,9 +2,8 @@
-
-
-
+
+ res.partner.event.info.inheritres.partner
@@ -12,34 +11,8 @@
-
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/hr_contract/i18n/th.po b/addons/hr_contract/i18n/th.po
new file mode 100644
index 00000000000..faa98497b01
--- /dev/null
+++ b/addons/hr_contract/i18n/th.po
@@ -0,0 +1,232 @@
+# Thai translation for openobject-addons
+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2012-12-21 17:05+0000\n"
+"PO-Revision-Date: 2013-06-15 17:09+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Thai
\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2013-06-16 04:38+0000\n"
+"X-Generator: Launchpad (build 16667)\n"
+
+#. module: hr_contract
+#: field:hr.contract,wage:0
+msgid "Wage"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Information"
+msgstr "ข้อมูล"
+
+#. module: hr_contract
+#: field:hr.contract,trial_date_start:0
+msgid "Trial Start Date"
+msgstr "วันที่เริ่มต้นการทดลอง"
+
+#. module: hr_contract
+#: field:hr.employee,vehicle:0
+msgid "Company Vehicle"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Group By..."
+msgstr "จัดกลุ่มตาม..."
+
+#. module: hr_contract
+#: field:hr.contract,department_id:0
+msgid "Department"
+msgstr "แผนก"
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: field:hr.contract,employee_id:0
+#: model:ir.model,name:hr_contract.model_hr_employee
+msgid "Employee"
+msgstr "พนักงาน"
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Search Contract"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: view:hr.employee:0
+#: field:hr.employee,contract_ids:0
+#: model:ir.actions.act_window,name:hr_contract.act_hr_employee_2_hr_contract
+#: model:ir.actions.act_window,name:hr_contract.action_hr_contract
+#: model:ir.ui.menu,name:hr_contract.hr_menu_contract
+msgid "Contracts"
+msgstr "สัญญา"
+
+#. module: hr_contract
+#: field:hr.employee,children:0
+msgid "Number of Children"
+msgstr "จำนวนบุตร"
+
+#. module: hr_contract
+#: help:hr.employee,contract_id:0
+msgid "Latest contract of the employee"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Job"
+msgstr "งาน"
+
+#. module: hr_contract
+#: field:hr.contract,advantages:0
+msgid "Advantages"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Work Permit"
+msgstr "ใบอนุญาตทำงาน"
+
+#. module: hr_contract
+#: model:ir.actions.act_window,name:hr_contract.action_hr_contract_type
+#: model:ir.ui.menu,name:hr_contract.hr_menu_contract_type
+msgid "Contract Types"
+msgstr "ประเภทสัญญา"
+
+#. module: hr_contract
+#: view:hr.employee:0
+msgid "Medical Exam"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,date_end:0
+msgid "End Date"
+msgstr "วันสิ้นสุด"
+
+#. module: hr_contract
+#: help:hr.contract,wage:0
+msgid "Basic Salary of the employee"
+msgstr "เงินเดือนของพนักงาน"
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: field:hr.contract,name:0
+msgid "Contract Reference"
+msgstr "อ้างอิงตามสัญญา"
+
+#. module: hr_contract
+#: help:hr.employee,vehicle_distance:0
+msgid "In kilometers"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: field:hr.contract,notes:0
+msgid "Notes"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,permit_no:0
+msgid "Work Permit No"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: view:hr.employee:0
+#: field:hr.employee,contract_id:0
+#: model:ir.model,name:hr_contract.model_hr_contract
+#: model:ir.ui.menu,name:hr_contract.next_id_56
+msgid "Contract"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: field:hr.contract,type_id:0
+#: view:hr.contract.type:0
+#: field:hr.contract.type,name:0
+#: model:ir.model,name:hr_contract.model_hr_contract_type
+msgid "Contract Type"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+#: field:hr.contract,working_hours:0
+msgid "Working Schedule"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Salary and Advantages"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,job_id:0
+msgid "Job Title"
+msgstr ""
+
+#. module: hr_contract
+#: constraint:hr.contract:0
+msgid "Error! Contract start-date must be less than contract end-date."
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.employee,manager:0
+msgid "Is a Manager"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,date_start:0
+msgid "Start Date"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,visa_no:0
+msgid "Visa No"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.employee,vehicle_distance:0
+msgid "Home-Work Dist."
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.employee,place_of_birth:0
+msgid "Place of Birth"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Trial Period Duration"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract:0
+msgid "Duration"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,visa_expire:0
+msgid "Visa Expire Date"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.employee,medic_exam:0
+msgid "Medical Examination Date"
+msgstr ""
+
+#. module: hr_contract
+#: field:hr.contract,trial_date_end:0
+msgid "Trial End Date"
+msgstr ""
+
+#. module: hr_contract
+#: view:hr.contract.type:0
+msgid "Search Contract Type"
+msgstr ""
diff --git a/addons/marketing_campaign/__init__.py b/addons/marketing_campaign/__init__.py
index 23796d1baaf..d37d8604380 100644
--- a/addons/marketing_campaign/__init__.py
+++ b/addons/marketing_campaign/__init__.py
@@ -20,7 +20,6 @@
##############################################################################
import marketing_campaign
-import res_partner
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/marketing_campaign/__openerp__.py b/addons/marketing_campaign/__openerp__.py
index a51347fd1bb..0a37f8aae0b 100644
--- a/addons/marketing_campaign/__openerp__.py
+++ b/addons/marketing_campaign/__openerp__.py
@@ -59,7 +59,6 @@ input segments, workflow.
'marketing_campaign_view.xml',
'marketing_campaign_data.xml',
'marketing_campaign_workflow.xml',
- 'res_partner_view.xml',
'report/campaign_analysis_view.xml',
'security/marketing_campaign_security.xml',
'security/ir.model.access.csv'
diff --git a/addons/marketing_campaign/res_partner.py b/addons/marketing_campaign/res_partner.py
deleted file mode 100644
index b012cbb7181..00000000000
--- a/addons/marketing_campaign/res_partner.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from openerp.osv import fields,osv
-
-class res_partner(osv.osv):
- _inherit = 'res.partner'
-
- _columns = {
- 'workitem_ids': fields.one2many('marketing.campaign.workitem',
- 'partner_id', 'Workitems',
- readonly=True),
- }
-
- def copy(self, cr, uid, id, default={}, context=None):
- default.update({
- 'workitem_ids': [],
- })
- return super(res_partner, self).copy(cr, uid, id, default=default, context=context)
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/marketing_campaign/res_partner_view.xml b/addons/marketing_campaign/res_partner_view.xml
deleted file mode 100644
index 63c65ccd97f..00000000000
--- a/addons/marketing_campaign/res_partner_view.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
- res.partner.workitem.info.inherit
- res.partner
-
-
-
- False
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 089c577e940..370aa2e55ff 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -51,7 +51,7 @@ class pos_config(osv.osv):
'journal_ids' : fields.many2many('account.journal', 'pos_config_journal_rel',
'pos_config_id', 'journal_id', 'Available Payment Methods',
domain="[('journal_user', '=', True ), ('type', 'in', ['bank', 'cash'])]",),
- 'shop_id' : fields.many2one('sale.shop', 'Shop',
+ 'warehouse_id' : fields.many2one('stock.warehouse', 'Warehouse',
required=True),
'journal_id' : fields.many2one('account.journal', 'Sale Journal',
domain=[('type', '=', 'sale')],
@@ -70,6 +70,7 @@ class pos_config(osv.osv):
"to customize the reference numbers of your orders."),
'session_ids': fields.one2many('pos.session', 'config_id', 'Sessions'),
'group_by' : fields.boolean('Group Journal Items', help="Check this if you want to group the Journal Items by Product while closing a Session"),
+ 'pricelist_id': fields.many2one('product.pricelist','Pricelist', required=True)
}
def _check_cash_control(self, cr, uid, ids, context=None):
@@ -112,15 +113,21 @@ class pos_config(osv.osv):
res = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'sale')], limit=1)
return res and res[0] or False
- def _default_shop(self, cr, uid, context=None):
- res = self.pool.get('sale.shop').search(cr, uid, [])
+ def _default_warehouse(self, cr, uid, context=None):
+ user = self.pool.get('res.users').browse(cr, uid, uid, context)
+ res = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', user.company_id.id)], limit=1, context=context)
+ return res and res[0] or False
+
+ def _default_pricelist(self, cr, uid, context=None):
+ res = self.pool.get('product.pricelist').search(cr, uid, [('type', '=', 'sale')], limit=1, context=context)
return res and res[0] or False
_defaults = {
'state' : POS_CONFIG_STATE[0][0],
- 'shop_id': _default_shop,
+ 'warehouse_id': _default_warehouse,
'journal_id': _default_sale_journal,
'group_by' : True,
+ 'pricelist_id': _default_pricelist
}
def set_active(self, cr, uid, ids, context=None):
@@ -306,7 +313,7 @@ class pos_session(osv.osv):
# the .xml files as the CoA is not yet installed.
jobj = self.pool.get('pos.config')
pos_config = jobj.browse(cr, uid, config_id, context=context)
- context.update({'company_id': pos_config.shop_id.company_id.id})
+ context.update({'company_id': pos_config.warehouse_id.company_id.id})
if not pos_config.journal_id:
jid = jobj.default_get(cr, uid, ['journal_id'], context=context)['journal_id']
if jid:
@@ -333,7 +340,7 @@ class pos_session(osv.osv):
bank_values = {
'journal_id' : journal.id,
'user_id' : uid,
- 'company_id' : pos_config.shop_id.company_id.id
+ 'company_id' : pos_config.warehouse_id.company_id.id
}
statement_id = self.pool.get('account.bank.statement').create(cr, uid, bank_values, context=context)
bank_statement_ids.append(statement_id)
@@ -594,7 +601,7 @@ class pos_order(osv.osv):
_columns = {
'name': fields.char('Order Ref', size=64, required=True, readonly=True),
'company_id':fields.many2one('res.company', 'Company', required=True, readonly=True),
- 'shop_id': fields.related('session_id', 'config_id', 'shop_id', relation='sale.shop', type='many2one', string='Shop', store=True, readonly=True),
+ 'warehouse_id': fields.related('session_id', 'config_id', 'warehouse_id', relation='stock.warehouse', type='many2one', string='Warehouse', store=True, readonly=True),
'date_order': fields.datetime('Order Date', readonly=True, select=True),
'user_id': fields.many2one('res.users', 'Salesman', help="Person who uses the the cash register. It can be a reliever, a student or an interim employee."),
'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'),
@@ -638,8 +645,7 @@ class pos_order(osv.osv):
session_ids = self._default_session(cr, uid, context)
if session_ids:
session_record = self.pool.get('pos.session').browse(cr, uid, session_ids, context=context)
- shop = self.pool.get('sale.shop').browse(cr, uid, session_record.config_id.shop_id.id, context=context)
- return shop.pricelist_id and shop.pricelist_id.id or False
+ return session_record.config_id.pricelist_id and session_record.config_id.pricelist_id.id or False
return False
_defaults = {
@@ -690,8 +696,8 @@ class pos_order(osv.osv):
'auto_picking': True,
}, context=context)
self.write(cr, uid, [order.id], {'picking_id': picking_id}, context=context)
- location_id = order.shop_id.warehouse_id.lot_stock_id.id
- output_id = order.shop_id.warehouse_id.lot_output_id.id
+ location_id = order.warehouse_id.lot_stock_id.id
+ output_id = order.warehouse_id.lot_output_id.id
for line in order.lines:
if line.product_id and line.product_id.type == 'service':
diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml
index 5b23e94ca23..4bd1a6a84aa 100644
--- a/addons/point_of_sale/point_of_sale_view.xml
+++ b/addons/point_of_sale/point_of_sale_view.xml
@@ -84,7 +84,7 @@
-
+
@@ -769,12 +769,16 @@
-
-
-
-
-
-
+
+
+ The OpenERP issues tacker allows you to efficiantly manage things
+ like internal requests, software development bugs, customer
+ complaints, project troubles, material breakdowns, etc.
+
- 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.
-
['|',('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])]
-
-
diff --git a/addons/sale_analytic_plans/sale_analytic_plans.py b/addons/sale_analytic_plans/sale_analytic_plans.py
index 522f6b6f0fb..51262343d68 100644
--- a/addons/sale_analytic_plans/sale_analytic_plans.py
+++ b/addons/sale_analytic_plans/sale_analytic_plans.py
@@ -38,14 +38,4 @@ class sale_order_line(osv.osv):
return create_ids
-class sale_order(osv.osv):
- _inherit = "sale.order"
-
- def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
- # Remove the project_id from the result of super() call, if any, as this field is not in the view anymore
- res = super(sale_order, self).onchange_shop_id(cr, uid, ids, shop_id, context=context)
- if res.get('value',{}).get('project_id'):
- del(res['value']['project_id'])
- return res
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_crm/test/sale_crm.yml b/addons/sale_crm/test/sale_crm.yml
index 011fb6ad5a8..21d2cc08195 100644
--- a/addons/sale_crm/test/sale_crm.yml
+++ b/addons/sale_crm/test/sale_crm.yml
@@ -1,14 +1,3 @@
--
- Make sure the main company has at least one shop.
--
- !python {model: sale.shop}: |
- company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
- shop_ids = self.search(cr, uid, [('company_id', '=', company_id)])
- if not shop_ids:
- # take a shop, and assign it to the user's company
- shop_ids = self.search(cr, uid, [])
- if shop_ids:
- self.write(cr, uid, [shop_ids[0]], {'company_id': company_id})
-
I open the wizard "Make sales".
-
diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py
index bd91e47b886..b74817059e4 100644
--- a/addons/sale_crm/wizard/crm_make_sale.py
+++ b/addons/sale_crm/wizard/crm_make_sale.py
@@ -95,7 +95,6 @@ class crm_make_sale(osv.osv_memory):
'origin': _('Opportunity: %s') % str(case.id),
'section_id': case.section_id and case.section_id.id or False,
'categ_ids': [(6, 0, [categ_id.id for categ_id in case.categ_ids])],
- 'shop_id': make.shop_id.id,
'partner_id': partner.id,
'pricelist_id': pricelist,
'partner_invoice_id': partner_addr['invoice'],
@@ -140,18 +139,12 @@ class crm_make_sale(osv.osv_memory):
}
return value
- def _get_shop_id(self, cr, uid, ids, context=None):
- cmpny_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
- shop = self.pool.get('sale.shop').search(cr, uid, [('company_id', '=', cmpny_id)])
- return shop and shop[0] or False
_columns = {
- 'shop_id': fields.many2one('sale.shop', 'Shop', required=True),
'partner_id': fields.many2one('res.partner', 'Customer', required=True, domain=[('customer','=',True)]),
'close': fields.boolean('Mark Won', help='Check this to close the opportunity after having created the sales order.'),
}
_defaults = {
- 'shop_id': _get_shop_id,
'close': False,
'partner_id': _selectPartner,
}
diff --git a/addons/sale_crm/wizard/crm_make_sale_view.xml b/addons/sale_crm/wizard/crm_make_sale_view.xml
index 2207cf536e2..695f3e919eb 100644
--- a/addons/sale_crm/wizard/crm_make_sale_view.xml
+++ b/addons/sale_crm/wizard/crm_make_sale_view.xml
@@ -10,7 +10,6 @@
+
+ sale.report.search.sale.stock
+ sale.report
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/sale_stock/res_config.py b/addons/sale_stock/res_config.py
index d06b6a81b32..4c3b92f1d33 100644
--- a/addons/sale_stock/res_config.py
+++ b/addons/sale_stock/res_config.py
@@ -50,9 +50,6 @@ class sale_configuration(osv.osv_memory):
'group_mrp_properties': fields.boolean('Product properties on order lines',
implied_group='sale.group_mrp_properties',
help="Allows you to tag sales order lines with properties."),
- 'group_multiple_shops': fields.boolean("Manage multiple shops",
- implied_group='stock.group_locations',
- help="This allows to configure and use multiple shops."),
'module_project_timesheet': fields.boolean("Project Timesheet"),
'module_project_mrp': fields.boolean("Project MRP"),
}
diff --git a/addons/sale_stock/res_config_view.xml b/addons/sale_stock/res_config_view.xml
index ad3b91b2a30..93bc8e5980e 100644
--- a/addons/sale_stock/res_config_view.xml
+++ b/addons/sale_stock/res_config_view.xml
@@ -59,12 +59,6 @@
-
-
-
-
-
-
diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py
index 92aa9d9aaf3..3f7ac28c900 100644
--- a/addons/sale_stock/sale_stock.py
+++ b/addons/sale_stock/sale_stock.py
@@ -27,13 +27,6 @@ from openerp.tools.translate import _
import pytz
from openerp import SUPERUSER_ID
-class sale_shop(osv.osv):
- _inherit = "sale.shop"
- _columns = {
- 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
- }
-
-
class sale_order(osv.osv):
_inherit = "sale.order"
@@ -70,9 +63,16 @@ class sale_order(osv.osv):
vals.update({'invoice_quantity': 'order'})
if vals['order_policy'] == 'picking':
vals.update({'invoice_quantity': 'procurement'})
- order = super(sale_order, self).create(cr, uid, vals, context=context)
+ order = super(sale_order, self).create(cr, uid, vals, context=context)
return order
+ def _get_default_warehouse(self, cr, uid, context=None):
+ company_id = self.pool.get('res.users')._get_company(cr, uid, context=context)
+ warehouse_ids = self.pool.get('stock.warehouse').search(cr, uid, [('company_id', '=', company_id)], context=context)
+ if not warehouse_ids:
+ raise osv.except_osv(_('Error!'), _('There is no warehouse defined for current company.'))
+ return warehouse_ids[0]
+
# This is False
def _picked_rate(self, cr, uid, ids, name, arg, context=None):
if not ids:
@@ -140,11 +140,13 @@ class sale_order(osv.osv):
'picking_ids': fields.one2many('stock.picking.out', 'sale_id', 'Related Picking', readonly=True, help="This is a list of delivery orders that has been generated for this sales order."),
'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sales order has been delivered. This field is updated only after the scheduler(s) have been launched."),
'picked_rate': fields.function(_picked_rate, string='Picked', type='float'),
+ 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on',
help="The sales order will automatically create the invoice proposition (draft invoice).\
You have to choose if you want your invoice based on ordered ", required=True, readonly=True, states={'draft': [('readonly', False)]}),
}
_defaults = {
+ 'warehouse_id': _get_default_warehouse,
'picking_policy': 'direct',
'order_policy': 'manual',
'invoice_quantity': 'order',
@@ -162,6 +164,14 @@ class sale_order(osv.osv):
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
+ def onchange_warehouse_id(self, cr, uid, ids, warehouse_id, context=None):
+ val = {}
+ if warehouse_id:
+ warehouse = self.pool.get('stock.warehouse').browse(cr, uid, warehouse_id, context=context)
+ if warehouse.company_id:
+ val['company_id'] = warehouse.company_id.id
+ return {'value': val}
+
def action_view_delivery(self, cr, uid, ids, context=None):
'''
This function returns an action that display existing delivery orders of given sales order ids. It can either be a in a list or in a form view, if there is only one delivery order to show.
@@ -297,7 +307,7 @@ class sale_order(osv.osv):
or line.product_uom_qty,
'product_uos': (line.product_uos and line.product_uos.id)\
or line.product_uom.id,
- 'location_id': order.shop_id.warehouse_id.lot_stock_id.id,
+ 'location_id': order.warehouse_id.lot_stock_id.id,
'procure_method': line.type,
'move_id': move_id,
'company_id': order.company_id.id,
@@ -305,8 +315,8 @@ class sale_order(osv.osv):
}
def _prepare_order_line_move(self, cr, uid, order, line, picking_id, date_planned, context=None):
- location_id = order.shop_id.warehouse_id.lot_stock_id.id
- output_id = order.shop_id.warehouse_id.lot_output_id.id
+ location_id = order.warehouse_id.lot_stock_id.id
+ output_id = order.warehouse_id.lot_output_id.id
return {
'name': line.name,
'picking_id': picking_id,
diff --git a/addons/sale_stock/sale_stock_data.xml b/addons/sale_stock/sale_stock_data.xml
deleted file mode 100644
index bb4944bd87e..00000000000
--- a/addons/sale_stock/sale_stock_data.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/sale_stock/sale_stock_demo.xml b/addons/sale_stock/sale_stock_demo.xml
index 15b1e60b829..2e7b641659d 100644
--- a/addons/sale_stock/sale_stock_demo.xml
+++ b/addons/sale_stock/sale_stock_demo.xml
@@ -3,21 +3,37 @@
+ prepaid
-
+
+
+
+
+
+
+
+
+
+ prepaid
+ picking
+ picking
+
+
+
+
diff --git a/addons/sale_stock/sale_stock_view.xml b/addons/sale_stock/sale_stock_view.xml
index 9d852405b9e..b66177d374b 100644
--- a/addons/sale_stock/sale_stock_view.xml
+++ b/addons/sale_stock/sale_stock_view.xml
@@ -2,31 +2,6 @@
-
- sale.shop.inherit.form
- sale.shop
-
-
-
-
-
-
-
-
-
-
- sale.shop.sale.stock
- sale.shop
-
-
-
-
-
-
-
-
-
-
sale.order.form.sale.stocksale.order
@@ -48,17 +23,20 @@
-
-
-
+
+
+
+
+
+
-
@@ -78,7 +56,7 @@
groups="sale.group_mrp_properties"/>
-
+
diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml
index afffda1ef21..4a6f3d38f97 100644
--- a/addons/sale_stock/test/picking_order_policy.yml
+++ b/addons/sale_stock/test/picking_order_policy.yml
@@ -63,8 +63,8 @@
assert picking.note == sale_order.note,"Note is not correspond with sale order."
assert picking.invoice_state == (sale_order.order_policy=='picking' and '2binvoiced') or 'none',"Invoice policy is not correspond with sale order."
assert len(picking.move_lines) == len(sale_order.order_line), "Total move of delivery order are not corresposning with total sale order lines."
- location_id = sale_order.shop_id.warehouse_id.lot_stock_id.id
- output_id = sale_order.shop_id.warehouse_id.lot_output_id.id
+ location_id = sale_order.warehouse_id.lot_stock_id.id
+ output_id = sale_order.warehouse_id.lot_output_id.id
for move in picking.move_lines:
order_line = move.sale_line_id
sale_order_date = self.date_to_datetime(cr, uid, sale_order.date_order, context)
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 29445f671ee..f31c2b21ef1 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -205,7 +205,6 @@ class product_product(osv.osv):
location_obj = self.pool.get('stock.location')
warehouse_obj = self.pool.get('stock.warehouse')
- shop_obj = self.pool.get('sale.shop')
states = context.get('states',[])
what = context.get('what',())
@@ -215,11 +214,6 @@ class product_product(osv.osv):
if not ids:
return res
- if context.get('shop', False):
- warehouse_id = shop_obj.read(cr, uid, int(context['shop']), ['warehouse_id'])['warehouse_id'][0]
- if warehouse_id:
- context['warehouse'] = warehouse_id
-
if context.get('warehouse', False):
lot_id = warehouse_obj.read(cr, uid, int(context['warehouse']), ['lot_stock_id'])['lot_stock_id'][0]
if lot_id:
@@ -372,7 +366,6 @@ class product_product(osv.osv):
"In a context with a single Warehouse, this includes "
"goods stored in the Stock Location of this Warehouse, or any "
"of its children.\n"
- "In a context with a single Shop, this includes goods "
"stored in the Stock Location of the Warehouse of this Shop, "
"or any of its children.\n"
"Otherwise, this includes goods stored in any Stock Location "
@@ -387,7 +380,6 @@ class product_product(osv.osv):
"In a context with a single Warehouse, this includes "
"goods stored in the Stock Location of this Warehouse, or any "
"of its children.\n"
- "In a context with a single Shop, this includes goods "
"stored in the Stock Location of the Warehouse of this Shop, "
"or any of its children.\n"
"Otherwise, this includes goods stored in any Stock Location "
diff --git a/addons/stock_location/stock_location_demo_cpu1.xml b/addons/stock_location/stock_location_demo_cpu1.xml
index d9a220daef6..c756dac2566 100644
--- a/addons/stock_location/stock_location_demo_cpu1.xml
+++ b/addons/stock_location/stock_location_demo_cpu1.xml
@@ -75,17 +75,5 @@
-
- Chicago Shop
-
-
-
-
-
- Birmingham shop
-
-
-
-
\ No newline at end of file