summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-02-02 12:25:06 +0100
committerChristophe Simonis <chs@odoo.com>2016-02-02 12:25:06 +0100
commit9ca7ad87b2bd06c4fae5d3428e2262eacf9fdb60 (patch)
treee2cbc5c8c7d878d655136a9fc3c57e0d256869f9 /addons
parent5b77e304299cfc92376ceb35e0f5587c0694bcbc (diff)
parent3ac46ee3d4b9775c5d18acc8ffb95188508a20af (diff)
[MERGE] forward port of branch 8.0 up to 3ac46ee
Diffstat (limited to 'addons')
-rw-r--r--addons/account/account_bank_statement.py1
-rw-r--r--addons/account/account_view.xml2
-rw-r--r--addons/delivery/sale.py5
-rw-r--r--addons/sale_margin/sale_margin.py2
-rw-r--r--addons/stock/i18n/stock.pot6
-rw-r--r--addons/stock/stock.py14
-rw-r--r--addons/web/static/src/xml/base.xml12
7 files changed, 31 insertions, 11 deletions
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index 9f6cedd9102..ff54a5c0590 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -1011,6 +1011,7 @@ class account_bank_statement_line(osv.osv):
}
_defaults = {
'date': lambda self,cr,uid,context={}: context.get('date', fields.date.context_today(self,cr,uid,context=context)),
+ 'sequence': 1,
}
class account_statement_operation_template(osv.osv):
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 548c0de2899..40ce9f08ae8 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -601,7 +601,7 @@
<page string="Transactions" name="statement_line_ids">
<field name="line_ids" context="{'date':date}">
<tree editable="bottom" string="Statement lines" colors="grey:journal_entry_ids">
- <field name="sequence" readonly="1" invisible="1"/>
+ <field name="sequence" widget="handle"/>
<field name="journal_entry_ids" invisible="1"/>
<field name="date" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
<field name="name" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
diff --git a/addons/delivery/sale.py b/addons/delivery/sale.py
index 54c5d124200..0a4a34e3ca1 100644
--- a/addons/delivery/sale.py
+++ b/addons/delivery/sale.py
@@ -95,6 +95,11 @@ class sale_order(osv.Model):
'tax_id': [(6, 0, taxes_ids)],
'is_delivery': True,
}
+ res = line_obj.product_id_change(cr, uid, ids, order.pricelist_id.id, values['product_id'],
+ qty=values['product_uom_qty'], uom=False, qty_uos=0, uos=False, name='', partner_id=order.partner_id.id,
+ lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None)
+ if res['value'].get('purchase_price'):
+ values['purchase_price'] = res['value'].get('purchase_price')
if order.order_line:
values['sequence'] = order.order_line[-1].sequence + 1
line_id = line_obj.create(cr, uid, values, context=context)
diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py
index e44e3815811..2d8af48ce66 100644
--- a/addons/sale_margin/sale_margin.py
+++ b/addons/sale_margin/sale_margin.py
@@ -87,7 +87,7 @@ class sale_order(osv.osv):
_columns = {
'margin': fields.function(_product_margin, string='Margin', help="It gives profitability by calculating the difference between the Unit Price and the cost price.", store={
- 'sale.order.line': (_get_order, ['margin', 'purchase_price'], 20),
+ 'sale.order.line': (_get_order, ['margin', 'purchase_price', 'order_id'], 20),
'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 20),
}, digits_compute= dp.get_precision('Product Price')),
}
diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot
index daae3a0fc74..805485062d1 100644
--- a/addons/stock/i18n/stock.pot
+++ b/addons/stock/i18n/stock.pot
@@ -52,6 +52,12 @@ msgid " (reserved)"
msgstr ""
#. module: stock
+#: code:addons/stock/stock.py:2954
+#, python-format
+msgid "You cannot have two inventory adjustements in state 'in Progess' with the same product(%s), same location(%s), same package, same owner and same lot. Please first validate the first inventory adjustement with this product before creating another one."
+msgstr ""
+
+#. module: stock
#: code:addons/stock/stock.py:3090
#, python-format
msgid " MTO"
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index c62e5a9b761..4ea86e1d901 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -2072,6 +2072,10 @@ class stock_move(osv.osv):
propagated_changes_dict['product_uom_qty'] = vals['product_uom_qty']
if vals.get('product_uom_id'):
propagated_changes_dict['product_uom_id'] = vals['product_uom_id']
+ if vals.get('product_uos_qty'):
+ propagated_changes_dict['product_uos_qty'] = vals['product_uos_qty']
+ if vals.get('product_uos_id'):
+ propagated_changes_dict['product_uos_id'] = vals['product_uos_id']
#propagation of expected date:
propagated_date_field = False
if vals.get('date_expected'):
@@ -2991,9 +2995,15 @@ class stock_inventory_line(osv.osv):
}
def create(self, cr, uid, values, context=None):
- if context is None:
- context = {}
product_obj = self.pool.get('product.product')
+ dom = [('product_id', '=', values.get('product_id')), ('inventory_id.state', '=', 'confirm'),
+ ('location_id', '=', values.get('location_id')), ('partner_id', '=', values.get('partner_id')),
+ ('package_id', '=', values.get('package_id')), ('prod_lot_id', '=', values.get('prod_lot_id'))]
+ res = self.search(cr, uid, dom, context=context)
+ if res:
+ location = self.pool['stock.location'].browse(cr, uid, values.get('location_id'), context=context)
+ product = product_obj.browse(cr, uid, values.get('product_id'), context=context)
+ raise Warning(_("You cannot have two inventory adjustements in state 'in Progess' with the same product(%s), same location(%s), same package, same owner and same lot. Please first validate the first inventory adjustement with this product before creating another one.") % (product.name, location.name))
if 'product_id' in values and not 'product_uom_id' in values:
values['product_uom_id'] = product_obj.browse(cr, uid, values.get('product_id'), context=context).uom_id.id
return super(stock_inventory_line, self).create(cr, uid, values, context=context)
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 39173add5c6..51fc676d8ce 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -1945,13 +1945,11 @@
<t t-name="FieldMany2ManyCheckBoxes">
<t t-foreach="widget.get('records')" t-as="record">
<div>
- <t t-if="selected[record[0]]">
- <input type="checkbox" t-att-data-record-id="JSON.stringify(record[0])" checked="true"/>
- </t>
- <t t-if="! selected[record[0]]">
- <input type="checkbox" t-att-data-record-id="JSON.stringify(record[0])"/>
- </t>
- <t t-esc="record[1]"/>
+ <label style="font-weight: normal">
+ <input type="checkbox" t-att-data-record-id="JSON.stringify(record[0])"
+ t-att-checked="selected[record[0]] or null"/>
+ <t t-esc="record[1]"/>
+ </label>
</div>
</t>
</t>