Remove warehouse as it is not always required on sale
review229007
This commit is contained in:
1 parent
fd646da4ff
commit
79c7a43e61
3 files changed
+2
-17
No files matched your search
@@ -1,3 +1,5 @@
|
||||
* Remove warehouse
|
||||
|
||||
Version 2.2.0 - 2011-10-25
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
|
||||
|
||||
@@ -51,13 +51,6 @@ class SaleOpportunity(ModelWorkflow, ModelSQL, ModelView):
|
||||
'get_currency_digits')
|
||||
amount = fields.Numeric('Amount', digits=(16, Eval('currency_digits', 2)),
|
||||
depends=['currency_digits'], help='Estimated revenue amount')
|
||||
warehouse = fields.Many2One('stock.location', 'Warehouse',
|
||||
domain=[('type', '=', 'warehouse')], states={
|
||||
'required': Eval('state') == 'converted',
|
||||
'readonly': In(Eval('state'),
|
||||
['converted', 'lost', 'cancelled']),
|
||||
},
|
||||
depends=['state'])
|
||||
payment_term = fields.Many2One('account.invoice.payment_term',
|
||||
'Payment Term', states={
|
||||
'required': Eval('state') == 'converted',
|
||||
@@ -139,13 +132,6 @@ class SaleOpportunity(ModelWorkflow, ModelSQL, ModelView):
|
||||
return payment_term_ids[0]
|
||||
return False
|
||||
|
||||
def default_warehouse(self):
|
||||
location_obj = Pool().get('stock.location')
|
||||
location_ids = location_obj.search(self.warehouse.domain)
|
||||
if len(location_ids) == 1:
|
||||
return location_ids[0]
|
||||
return False
|
||||
|
||||
def get_currency(self, ids, name):
|
||||
res = {}
|
||||
for opportunity in self.browse(ids):
|
||||
@@ -221,7 +207,6 @@ class SaleOpportunity(ModelWorkflow, ModelSQL, ModelView):
|
||||
'party': opportunity.party.id,
|
||||
'payment_term': opportunity.payment_term.id,
|
||||
'company': opportunity.company.id,
|
||||
'warehouse': opportunity.warehouse.id,
|
||||
'invoice_address': opportunity.address and opportunity.address.id,
|
||||
'shipment_address': opportunity.address and opportunity.address.id,
|
||||
'currency': opportunity.company.currency.id,
|
||||
|
||||
@@ -41,8 +41,6 @@
|
||||
<field name="start_date"/>
|
||||
<label name="end_date"/>
|
||||
<field name="end_date"/>
|
||||
<label name="warehouse"/>
|
||||
<field name="warehouse"/>
|
||||
<label name="payment_term"/>
|
||||
<field name="payment_term"/>
|
||||
<label name="sale"/>
|
||||
|
||||
Reference in new issue
Block a user