parent
6748bbe247
commit
907005c50c
|
@ -1,4 +1,4 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ msgctxt "field:sale_pos.set_quantities.start,total_quantity:"
|
||||||
msgid "Total Quantity"
|
msgid "Total Quantity"
|
||||||
msgstr "Quantitat total"
|
msgstr "Quantitat total"
|
||||||
|
|
||||||
msgctxt "field:sale_pos.set_quantities.start,unit_digits:"
|
msgctxt "field:sale_pos.set_quantities.start,unit:"
|
||||||
msgid "Unit Digits"
|
msgid "Unit"
|
||||||
msgstr "Dígits unitat"
|
msgstr "Unitat"
|
||||||
|
|
||||||
msgctxt "field:sale_pos.set_quantities.start.line,attribute_value_x:"
|
msgctxt "field:sale_pos.set_quantities.start.line,attribute_value_x:"
|
||||||
msgid "Value"
|
msgid "Value"
|
|
@ -1,4 +1,4 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
msgstr "Content-Type: text/plain; charset=utf-8\n"
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ msgctxt "field:sale_pos.set_quantities.start,total_quantity:"
|
||||||
msgid "Total Quantity"
|
msgid "Total Quantity"
|
||||||
msgstr "Cantidad total"
|
msgstr "Cantidad total"
|
||||||
|
|
||||||
msgctxt "field:sale_pos.set_quantities.start,unit_digits:"
|
msgctxt "field:sale_pos.set_quantities.start,unit:"
|
||||||
msgid "Unit Digits"
|
msgid "Unit"
|
||||||
msgstr "Dígitos unidad"
|
msgstr "Unidad"
|
||||||
|
|
||||||
msgctxt "field:sale_pos.set_quantities.start.line,attribute_value_x:"
|
msgctxt "field:sale_pos.set_quantities.start.line,attribute_value_x:"
|
||||||
msgid "Value"
|
msgid "Value"
|
||||||
|
@ -58,9 +58,9 @@ msgctxt "field:sale_pos.set_quantities.start.line,total:"
|
||||||
msgid "Total"
|
msgid "Total"
|
||||||
msgstr "Total"
|
msgstr "Total"
|
||||||
|
|
||||||
msgctxt "field:sale_pos.set_quantities.start.line,unit_digits:"
|
msgctxt "field:sale_pos.set_quantities.start.line,unit:"
|
||||||
msgid "Unit Digits"
|
msgid "Unit"
|
||||||
msgstr "Dígitos unidad"
|
msgstr "Unidad"
|
||||||
|
|
||||||
msgctxt "model:ir.action,name:wizard_set_quantities"
|
msgctxt "model:ir.action,name:wizard_set_quantities"
|
||||||
msgid "Set Quantities"
|
msgid "Set Quantities"
|
17
sale.py
17
sale.py
|
@ -292,9 +292,8 @@ class SetQuantitiesStart(ModelView):
|
||||||
'Quantities', size=Eval('n_lines', 0), depends=['n_lines'])
|
'Quantities', size=Eval('n_lines', 0), depends=['n_lines'])
|
||||||
n_lines = fields.Integer('Quantities')
|
n_lines = fields.Integer('Quantities')
|
||||||
total_quantity = fields.Float('Total Quantity',
|
total_quantity = fields.Float('Total Quantity',
|
||||||
digits=(16, Eval('unit_digits', 2)), readonly=True,
|
digits='unit', readonly=True)
|
||||||
depends=['unit_digits'])
|
unit = fields.Many2One('product.uom', 'Unit')
|
||||||
unit_digits = fields.Integer('Unit Digits')
|
|
||||||
|
|
||||||
@fields.depends('lines')
|
@fields.depends('lines')
|
||||||
def on_change_with_total_quantity(self):
|
def on_change_with_total_quantity(self):
|
||||||
|
@ -316,11 +315,9 @@ class SetQuantitiesStartLine(ModelView):
|
||||||
required=True)
|
required=True)
|
||||||
attribute_value_x = fields.Many2One('product.attribute.value', 'Value',
|
attribute_value_x = fields.Many2One('product.attribute.value', 'Value',
|
||||||
required=True, readonly=True)
|
required=True, readonly=True)
|
||||||
attribute_value_y = fields.Float('Quantity',
|
attribute_value_y = fields.Float('Quantity', digits='unit')
|
||||||
digits=(16, Eval('unit_digits', 2)), depends=['unit_digits'])
|
total = fields.Float('Total', digits='unit', readonly=True)
|
||||||
total = fields.Float('Total', digits=(16, Eval('unit_digits', 2)),
|
unit = fields.Many2One('product.uom', 'Unit')
|
||||||
readonly=True, depends=['unit_digits'])
|
|
||||||
unit_digits = fields.Integer('Unit Digits')
|
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name, value):
|
||||||
if name.startswith('attribute_value_y_'):
|
if name.startswith('attribute_value_y_'):
|
||||||
|
@ -443,7 +440,7 @@ class SetQuantities(Wizard):
|
||||||
line_vals = {
|
line_vals = {
|
||||||
'attribute_value_x': attr_value_x.id,
|
'attribute_value_x': attr_value_x.id,
|
||||||
'attribute_value_x.rec_name': attr_value_x.rec_name,
|
'attribute_value_x.rec_name': attr_value_x.rec_name,
|
||||||
'unit_digits': template_line.unit.digits,
|
'unit': template_line.unit.id,
|
||||||
}
|
}
|
||||||
line_total_quantity = 0.0
|
line_total_quantity = 0.0
|
||||||
for attr_value_y, product in list(y_values.items()):
|
for attr_value_y, product in list(y_values.items()):
|
||||||
|
@ -461,7 +458,7 @@ class SetQuantities(Wizard):
|
||||||
'lines': lines_vlist,
|
'lines': lines_vlist,
|
||||||
'n_lines': len(lines_vlist),
|
'n_lines': len(lines_vlist),
|
||||||
'total_quantity': total_quantity,
|
'total_quantity': total_quantity,
|
||||||
'unit_digits': template_line.unit.digits,
|
'unit': template_line.unit.id,
|
||||||
}
|
}
|
||||||
|
|
||||||
def transition_set_(self, *args, **kwargs):
|
def transition_set_(self, *args, **kwargs):
|
||||||
|
|
|
@ -4,6 +4,5 @@
|
||||||
<form>
|
<form>
|
||||||
<field name="attribute_value_x"/>
|
<field name="attribute_value_x"/>
|
||||||
<field name="total"/>
|
<field name="total"/>
|
||||||
<field name="unit_digits" invisible="1"/>
|
|
||||||
<newline/>
|
<newline/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -4,5 +4,4 @@
|
||||||
<tree editable="1">
|
<tree editable="1">
|
||||||
<field name="attribute_value_x"/>
|
<field name="attribute_value_x"/>
|
||||||
<field name="total"/>
|
<field name="total"/>
|
||||||
<field name="unit_digits" tree_invisible="1"/>
|
|
||||||
</tree>
|
</tree>
|
||||||
|
|
Loading…
Reference in New Issue