Compare commits
5 Commits
b99ddd17fe
...
5ae836dbf3
Author | SHA1 | Date |
---|---|---|
Juanjo Garcia Pagan | 5ae836dbf3 | |
Juanjo Garcia | f83eb8c5ca | |
Raimon Esteve | 4fd8dd6fc2 | |
Raimon Esteve | 6d9e63f64f | |
Raimon Esteve | 8bb2ca855a |
|
@ -0,0 +1,25 @@
|
|||
diff --git a/tryton/modules/stock_lot/stock.py b/tryton/modules/stock_lot/stock.py
|
||||
index 734018dbe8..1367b57e5f 100644
|
||||
--- a/tryton/modules/stock_lot/stock.py
|
||||
+++ b/tryton/modules/stock_lot/stock.py
|
||||
@@ -420,8 +420,7 @@ class Move(metaclass=PoolMeta):
|
||||
|
||||
def check_lot(self):
|
||||
"Check if lot is required"
|
||||
- if (self.state == 'done'
|
||||
- and self.internal_quantity
|
||||
+ if (self.internal_quantity
|
||||
and not self.lot
|
||||
and self.product.lot_is_required(
|
||||
self.from_location, self.to_location)):
|
||||
@@ -430,8 +429,9 @@ class Move(metaclass=PoolMeta):
|
||||
product=self.product.rec_name))
|
||||
|
||||
@classmethod
|
||||
- def validate(cls, moves):
|
||||
- super(Move, cls).validate(moves)
|
||||
+ @ModelView.button
|
||||
+ def do(cls, moves):
|
||||
+ super().do(moves)
|
||||
for move in moves:
|
||||
move.check_lot()
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/tryton/sao/src/model.js b/tryton/sao/src/model.js
|
||||
index 81e8639d9e..8b55441294 100644
|
||||
--- a/tryton/sao/src/model.js
|
||||
+++ b/tryton/sao/src/model.js
|
||||
@@ -2071,6 +2071,10 @@
|
||||
rec_name = '';
|
||||
}
|
||||
}
|
||||
+ if (value < 0) {
|
||||
+ value = null;
|
||||
+ rec_name = '';
|
||||
+ }
|
||||
Sao.setdefault(
|
||||
record._values, this.name + '.', {}).rec_name = rec_name;
|
||||
Sao.field.Many2One._super.set_client.call(this, record, value,
|
|
@ -0,0 +1,36 @@
|
|||
diff --git a/tryton/modules/account/move.py b/tryton/modules/account/move.py
|
||||
index b827237af4..ddbca0ae19 100644
|
||||
--- a/tryton/modules/account/move.py
|
||||
+++ b/tryton/modules/account/move.py
|
||||
@@ -1098,7 +1098,7 @@ class Line(MoveLineMixin, ModelSQL, ModelView):
|
||||
def on_change_move(self):
|
||||
if self.move:
|
||||
if not self.debit and not self.credit:
|
||||
- total = sum(l.debit - l.credit
|
||||
+ total = sum((l.debit or 0) - (l.credit or 0)
|
||||
for l in getattr(self.move, 'lines', []))
|
||||
self.debit = -total if total < 0 else Decimal(0)
|
||||
self.credit = total if total > 0 else Decimal(0)
|
||||
@@ -1169,7 +1169,8 @@ class Line(MoveLineMixin, ModelSQL, ModelView):
|
||||
'Set correct sign to amount_second_currency'
|
||||
if self.amount_second_currency:
|
||||
self.amount_second_currency = \
|
||||
- self.amount_second_currency.copy_sign(self.debit - self.credit)
|
||||
+ self.amount_second_currency.copy_sign(
|
||||
+ (self.debit or 0) - (self.credit or 0))
|
||||
|
||||
@fields.depends('account')
|
||||
def on_change_account(self):
|
||||
@@ -2402,9 +2403,11 @@ class ReconcileShow(ModelView):
|
||||
if self.currency:
|
||||
for line in self.lines:
|
||||
if line.second_currency == self.currency:
|
||||
- amount += line.amount_second_currency
|
||||
+ amount += (
|
||||
+ line.amount_second_currency or 0)
|
||||
elif line.currency == self.currency:
|
||||
- amount += line.debit - line.credit
|
||||
+ amount += (
|
||||
+ (line.debit or 0) - (line.credit or 0))
|
||||
amount = self.currency.round(amount)
|
||||
self.write_off_amount = amount
|
|
@ -0,0 +1,20 @@
|
|||
diff --git a/product.py b/product.py
|
||||
index 08537ed..34ccc24 100644
|
||||
--- a/tryton/modules/sale_supply/product.py
|
||||
+++ b/tryton/modules/sale_supply/product.py
|
||||
@@ -45,6 +56,7 @@ class Template(metaclass=PoolMeta):
|
||||
|
||||
super().__register__(module)
|
||||
|
||||
+ '''
|
||||
# Migration from 6.6: convert supply_on_sale from boolean to selection
|
||||
if migrate_supply_on_sale:
|
||||
cursor.execute(*table.update(
|
||||
@@ -58,6 +70,7 @@ class Template(metaclass=PoolMeta):
|
||||
['always'],
|
||||
where=h_table._temp_supply_on_sale == Literal(True)))
|
||||
h_table_h.drop_column('_temp_supply_on_sale')
|
||||
+ '''
|
||||
|
||||
@fields.depends(methods=['_notify_order_point'])
|
||||
def on_change_notify(self):
|
10
series
10
series
|
@ -62,8 +62,14 @@ update_trees_chart_accounts.diff # [account_account] Update trees of chart of ac
|
|||
|
||||
sao_document_field.diff # [sao] fix issue with loading of 'document' fields in sao
|
||||
|
||||
issue12799.diff # [sao] Convert negative id value as None when set by the client
|
||||
|
||||
issue12547.diff # [stock_lot] Check lot required only when changing move to done
|
||||
|
||||
issue12823.diff # [account] Use 0 as fallback for missing debit or credit in on_change functions
|
||||
|
||||
product_cost_price_migration.diff # [product] Add missing column in product_cost_price
|
||||
|
||||
table_rename.diff # [trytond] Add missing sequence rename in table_rename function
|
||||
|
||||
sequence_exist.diff # [trytond] Search sequences using pg_sequences instead of information_schema.sequences
|
||||
|
||||
sale_supply_supply_on_sale.diff # [sale_supply] Dont try to supply_on_sale field selection.
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
diff --git a/tryton/trytond/trytond/backend/postgresql/table.py b/tryton/trytond/trytond/backend/postgresql/table.py
|
||||
index e874ee61c0..769f07ccd5 100644
|
||||
--- a/tryton/trytond/trytond/backend/postgresql/table.py
|
||||
+++ b/tryton/trytond/trytond/backend/postgresql/table.py
|
||||
@@ -132,6 +132,11 @@ class TableHandler(TableHandlerInterface):
|
||||
and not cls.table_exist(new_name)):
|
||||
cursor.execute(SQL('ALTER TABLE {} RENAME TO {}').format(
|
||||
Identifier(old_name), Identifier(new_name)))
|
||||
+ # Migrate from 6.6: rename old sequence
|
||||
+ old_sequence = old_name + '_id_seq'
|
||||
+ new_sequence = new_name + '_id_seq'
|
||||
+ transaction.database.sequence_rename(
|
||||
+ transaction.connection, old_sequence, new_sequence)
|
||||
# Rename history table
|
||||
old_history = old_name + "__history"
|
||||
new_history = new_name + "__history"
|
Loading…
Reference in New Issue