Compare commits
3 Commits
d57ce0078d
...
ba07908d69
Author | SHA1 | Date |
---|---|---|
Albert Cervera i Areny | ba07908d69 | |
Raimon Esteve | b4f4c0dd2a | |
Raimon Esteve | b5a3b00fb9 |
|
@ -0,0 +1,23 @@
|
|||
diff --git a/tryton/modules/account/move.py b/tryton/modules/account/move.py
|
||||
index 123755b2e9..564a9dc7db 100644
|
||||
--- a/tryton/modules/account/move.py
|
||||
+++ b/tryton/modules/account/move.py
|
||||
@@ -946,7 +946,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)
|
||||
@@ -1014,7 +1014,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):
|
|
@ -0,0 +1,108 @@
|
|||
diff --git a/tryton/sao/src/sao.js b/tryton/sao/src/sao.js
|
||||
index f803f49f40..686ae2a6fe 100644
|
||||
--- a/tryton/sao/src/sao.js
|
||||
+++ b/tryton/sao/src/sao.js
|
||||
@@ -778,11 +778,14 @@ var Sao = {
|
||||
|
||||
Sao.main_menu_row_activate = function() {
|
||||
var screen = Sao.main_menu_screen;
|
||||
- // ids is not defined to prevent to add suffix
|
||||
- return Sao.Action.exec_keyword('tree_open', {
|
||||
- 'model': screen.model_name,
|
||||
- 'id': screen.get_id(),
|
||||
- }, null, false);
|
||||
+ const id = screen.get_id();
|
||||
+ if (id) {
|
||||
+ // ids is not defined to prevent to add suffix
|
||||
+ Sao.Action.exec_keyword('tree_open', {
|
||||
+ 'model': screen.model_name,
|
||||
+ 'id': screen.get_id(),
|
||||
+ }, null, false);
|
||||
+ }
|
||||
};
|
||||
|
||||
Sao.menu = function(preferences) {
|
||||
@@ -824,6 +827,7 @@ var Sao = {
|
||||
view.table.removeClass('table table-bordered');
|
||||
view.table.addClass('no-responsive');
|
||||
view.table.find('thead').hide();
|
||||
+ view.table.find('colgroup > col.tree-menu').css('width', 0);
|
||||
var gs = new Sao.GlobalSearch();
|
||||
jQuery('#global-search').empty();
|
||||
jQuery('#global-search').append(gs.el);
|
||||
diff --git a/tryton/sao/src/sao.less b/tryton/sao/src/sao.less
|
||||
index 46118c95ff..6cee9df988 100644
|
||||
--- a/tryton/sao/src/sao.less
|
||||
+++ b/tryton/sao/src/sao.less
|
||||
@@ -451,11 +451,13 @@ img.icon {
|
||||
}
|
||||
|
||||
td.draggable-handle, td.optional {
|
||||
- cursor: grab;
|
||||
> img {
|
||||
.center-block();
|
||||
}
|
||||
}
|
||||
+ td.draggable-handle {
|
||||
+ cursor: grab;
|
||||
+ }
|
||||
th.selection-state, td.selection-state {
|
||||
> input {
|
||||
.center-block();
|
||||
@@ -603,12 +605,13 @@ img.icon {
|
||||
cursor: pointer;
|
||||
> img {
|
||||
float: left;
|
||||
- margin-right: 5px;
|
||||
+ margin-right: 1em;
|
||||
[dir="rtl"] & {
|
||||
float: right;
|
||||
- margin-left: 5px;
|
||||
+ margin-left: 1em;
|
||||
}
|
||||
- width: 1em;
|
||||
+ width: unit(@line-height-base, em);
|
||||
+ height: unit(@line-height-base, em);
|
||||
}
|
||||
}
|
||||
label {
|
||||
diff --git a/tryton/sao/src/screen.js b/tryton/sao/src/screen.js
|
||||
index da51d8ffa1..1ffb0f5672 100644
|
||||
--- a/tryton/sao/src/screen.js
|
||||
+++ b/tryton/sao/src/screen.js
|
||||
@@ -1476,11 +1476,14 @@
|
||||
default_row_activate: function() {
|
||||
if ((this.current_view.view_type == 'tree') &&
|
||||
(this.current_view.attributes.keyword_open == 1)) {
|
||||
- Sao.Action.exec_keyword('tree_open', {
|
||||
- 'model': this.model_name,
|
||||
- 'id': this.get_id(),
|
||||
- 'ids': [this.get_id()]
|
||||
- }, this.local_context, false);
|
||||
+ const id = this.get_id();
|
||||
+ if (id) {
|
||||
+ Sao.Action.exec_keyword('tree_open', {
|
||||
+ 'model': this.model_name,
|
||||
+ 'id': this.get_id(),
|
||||
+ 'ids': [this.get_id()]
|
||||
+ }, this.local_context, false);
|
||||
+ }
|
||||
} else {
|
||||
if (!this.modified()) {
|
||||
this.switch_view('form');
|
||||
diff --git a/tryton/sao/src/view/tree.js b/tryton/sao/src/view/tree.js
|
||||
index 8d8c8b1685..e3f73178a3 100644
|
||||
--- a/tryton/sao/src/view/tree.js
|
||||
+++ b/tryton/sao/src/view/tree.js
|
||||
@@ -1523,6 +1523,11 @@
|
||||
this.expander.children().html(' ');
|
||||
this.expander.on('click keypress',
|
||||
Sao.common.click_press(this.toggle_row.bind(this)));
|
||||
+ this.expander.dblclick((evt) => {
|
||||
+ // prevent calling switch_row on td
|
||||
+ evt.preventDefault();
|
||||
+ evt.stopImmediatePropagation();
|
||||
+ });
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.tree.columns.length; i++) {
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/tryton/trytond/trytond/modules/product_price_list/price_list.py b/trytond/trytond/modules/product_price_list/price_list.py
|
||||
index 8d7299ed58..4c68662e1d 100644
|
||||
--- a/tryton/trytond/trytond/modules/product_price_list/price_list.py
|
||||
+++ b/tryton/trytond/trytond/modules/product_price_list/price_list.py
|
||||
@@ -85,8 +85,8 @@ class PriceList(DeactivableMixin, ModelSQL, ModelView):
|
||||
return {
|
||||
'names': {
|
||||
'unit_price': unit_price if unit_price is not None else Null(),
|
||||
- 'cost_price': cost_price if unit_price is not None else Null(),
|
||||
- 'list_price': list_price if unit_price is not None else Null(),
|
||||
+ 'cost_price': cost_price if cost_price is not None else Null(),
|
||||
+ 'list_price': list_price if list_price is not None else Null(),
|
||||
},
|
||||
}
|
||||
|
6
series
6
series
|
@ -134,6 +134,12 @@ issue12553.diff # [sao] Select first visible siblings when page is hidden
|
|||
|
||||
update_trees_chart_accounts.diff # [account_account] Update trees of chart of accounts with 2 passes
|
||||
|
||||
issue7707.diff # [sao] Improve tree view #163452
|
||||
|
||||
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_price_list.diff # [product_price_list] Fix cost_price and list_price values
|
||||
|
|
Loading…
Reference in New Issue