odoo-addon-account-reconcile-oca 16.0.1.2.12.3__py3-none-any.whl → 17.0.1.0.0.20__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. odoo/addons/account_reconcile_oca/README.rst +19 -18
  2. odoo/addons/account_reconcile_oca/__manifest__.py +4 -1
  3. odoo/addons/account_reconcile_oca/hooks.py +2 -2
  4. odoo/addons/account_reconcile_oca/i18n/account_reconcile_oca.pot +89 -8
  5. odoo/addons/account_reconcile_oca/i18n/ca.po +0 -5
  6. odoo/addons/account_reconcile_oca/i18n/es.po +2 -7
  7. odoo/addons/account_reconcile_oca/i18n/fr.po +0 -5
  8. odoo/addons/account_reconcile_oca/i18n/hr.po +0 -5
  9. odoo/addons/account_reconcile_oca/i18n/nl.po +0 -5
  10. odoo/addons/account_reconcile_oca/i18n/pt_BR.po +0 -5
  11. odoo/addons/account_reconcile_oca/i18n/sv.po +34 -39
  12. odoo/addons/account_reconcile_oca/i18n/tr.po +0 -5
  13. odoo/addons/account_reconcile_oca/models/__init__.py +3 -0
  14. odoo/addons/account_reconcile_oca/models/account_account_reconcile.py +2 -2
  15. odoo/addons/account_reconcile_oca/models/account_bank_statement.py +15 -0
  16. odoo/addons/account_reconcile_oca/models/account_bank_statement_line.py +98 -19
  17. odoo/addons/account_reconcile_oca/models/account_journal.py +15 -1
  18. odoo/addons/account_reconcile_oca/models/account_move_line.py +0 -1
  19. odoo/addons/account_reconcile_oca/models/account_reconcile_abstract.py +4 -2
  20. odoo/addons/account_reconcile_oca/models/res_company.py +14 -0
  21. odoo/addons/account_reconcile_oca/models/res_config_settings.py +12 -0
  22. odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.md +1 -0
  23. odoo/addons/account_reconcile_oca/readme/{DESCRIPTION.rst → DESCRIPTION.md} +2 -1
  24. odoo/addons/account_reconcile_oca/readme/ROADMAP.md +3 -0
  25. odoo/addons/account_reconcile_oca/readme/USAGE.md +10 -0
  26. odoo/addons/account_reconcile_oca/static/description/index.html +10 -9
  27. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_controller.esm.js +44 -4
  28. odoo/addons/account_reconcile_oca/static/src/js/reconcile/reconcile_renderer.esm.js +52 -1
  29. odoo/addons/account_reconcile_oca/static/src/js/reconcile_form/reconcile_form_controller.esm.js +3 -0
  30. odoo/addons/account_reconcile_oca/static/src/js/reconcile_manual/reconcile_manual_controller.esm.js +3 -0
  31. odoo/addons/account_reconcile_oca/static/src/js/reconcile_move_line/reconcile_move_line_renderer.esm.js +1 -1
  32. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_chatter_field.esm.js +11 -4
  33. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_data_widget.esm.js +22 -33
  34. odoo/addons/account_reconcile_oca/static/src/js/widgets/reconcile_move_line_widget.esm.js +62 -6
  35. odoo/addons/account_reconcile_oca/static/src/js/widgets/selection_badge_uncheck.esm.js +10 -1
  36. odoo/addons/account_reconcile_oca/static/src/scss/reconcile.scss +16 -15
  37. odoo/addons/account_reconcile_oca/static/src/xml/reconcile.xml +44 -10
  38. odoo/addons/account_reconcile_oca/tests/test_account_reconcile.py +15 -9
  39. odoo/addons/account_reconcile_oca/tests/test_bank_account_reconcile.py +28 -21
  40. odoo/addons/account_reconcile_oca/views/account_account.xml +3 -3
  41. odoo/addons/account_reconcile_oca/views/account_account_reconcile.xml +7 -7
  42. odoo/addons/account_reconcile_oca/views/account_bank_statement.xml +46 -0
  43. odoo/addons/account_reconcile_oca/views/account_bank_statement_line.xml +71 -37
  44. odoo/addons/account_reconcile_oca/views/account_journal.xml +10 -4
  45. odoo/addons/account_reconcile_oca/views/account_move.xml +1 -1
  46. odoo/addons/account_reconcile_oca/views/account_move_line.xml +8 -3
  47. odoo/addons/account_reconcile_oca/views/res_config_settings.xml +24 -0
  48. {odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info}/METADATA +27 -28
  49. odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info/RECORD +64 -0
  50. {odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info → odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info}/WHEEL +1 -1
  51. odoo_addon_account_reconcile_oca-17.0.1.0.0.20.dist-info/top_level.txt +1 -0
  52. odoo/addons/account_reconcile_oca/i18n/it.po +0 -598
  53. odoo/addons/account_reconcile_oca/migrations/16.0.1.2.0/pre-migration.py +0 -23
  54. odoo/addons/account_reconcile_oca/readme/CONTRIBUTORS.rst +0 -1
  55. odoo/addons/account_reconcile_oca/readme/ROADMAP.rst +0 -3
  56. odoo/addons/account_reconcile_oca/readme/USAGE.rst +0 -12
  57. odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info/RECORD +0 -61
  58. odoo_addon_account_reconcile_oca-16.0.1.2.12.3.dist-info/top_level.txt +0 -1
@@ -366,10 +366,11 @@ ul.auto-toc {
366
366
  !! This file is generated by oca-gen-addon-readme !!
367
367
  !! changes will be overwritten. !!
368
368
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369
- !! source digest: sha256:7fe40b33ad622d1d511a9203e3e94c024050eb427a77330a46a60977c6ce423b
369
+ !! source digest: sha256:eaa1b6b3dece89dbb5fd23794f5d597769b2e3cc3823ffb127b4dd7808251d19
370
370
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_oca"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_reconcile_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
- <p>This addon allows to reconcile bank statements and account marked as <cite>reconcile</cite>.</p>
371
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/17.0/account_reconcile_oca"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-reconcile-17-0/account-reconcile-17-0-account_reconcile_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372
+ <p>This addon allows to reconcile bank statements and account marked as
373
+ reconcile.</p>
373
374
  <p><strong>Table of contents</strong></p>
374
375
  <div class="contents local topic" id="contents">
375
376
  <ul class="simple">
@@ -392,13 +393,13 @@ ul.auto-toc {
392
393
  <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
393
394
  <div class="section" id="bank-reconcile">
394
395
  <h2><a class="toc-backref" href="#toc-entry-2">Bank reconcile</a></h2>
395
- <p>Access <cite>Invoicing / Dashboard</cite> with a user with Full Acounting capabilities.
396
- Select reconcile on the journal of your choice.</p>
396
+ <p>Access Invoicing / Dashboard with a user with Full Acounting
397
+ capabilities. Select reconcile on the journal of your choice.</p>
397
398
  </div>
398
399
  <div class="section" id="account-reconcile">
399
400
  <h2><a class="toc-backref" href="#toc-entry-3">Account reconcile</a></h2>
400
- <p>Access <cite>Invoicing / Accounting / Actions / Reconcile</cite>
401
- All the possible reconcile options will show and you will be able to reconcile properly.
401
+ <p>Access Invoicing / Accounting / Actions / Reconcile All the possible
402
+ reconcile options will show and you will be able to reconcile properly.
402
403
  You can access the same widget from accounts and Partners.</p>
403
404
  </div>
404
405
  </div>
@@ -414,7 +415,7 @@ You can access the same widget from accounts and Partners.</p>
414
415
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-reconcile/issues">GitHub Issues</a>.
415
416
  In case of trouble, please check there if your issue has already been reported.
416
417
  If you spotted it first, help us to smash it by providing a detailed and welcomed
417
- <a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_reconcile_oca%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
418
+ <a class="reference external" href="https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_reconcile_oca%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
418
419
  <p>Do not contact contributors directly about support or help with technical issues.</p>
419
420
  </div>
420
421
  <div class="section" id="credits">
@@ -441,7 +442,7 @@ mission is to support the collaborative development of Odoo features and
441
442
  promote its widespread use.</p>
442
443
  <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
443
444
  <p><a class="reference external image-reference" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
444
- <p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_oca">OCA/account-reconcile</a> project on GitHub.</p>
445
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-reconcile/tree/17.0/account_reconcile_oca">OCA/account-reconcile</a> project on GitHub.</p>
445
446
  <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
446
447
  </div>
447
448
  </div>
@@ -1,14 +1,17 @@
1
1
  /** @odoo-module */
2
- const {useState, useSubEnv} = owl;
2
+ const {onMounted, onWillStart, useState, useSubEnv} = owl;
3
+ import {useBus, useService} from "@web/core/utils/hooks";
3
4
  import {KanbanController} from "@web/views/kanban/kanban_controller";
4
5
  import {View} from "@web/views/view";
5
- import {useService} from "@web/core/utils/hooks";
6
+ import {formatMonetary} from "@web/views/fields/formatters";
6
7
 
7
8
  export class ReconcileController extends KanbanController {
8
9
  async setup() {
9
10
  super.setup();
10
11
  this.state = useState({
11
12
  selectedRecordId: null,
13
+ journalBalance: 0,
14
+ currency: false,
12
15
  });
13
16
  useSubEnv({
14
17
  parentController: this,
@@ -19,7 +22,42 @@ export class ReconcileController extends KanbanController {
19
22
  this.action = useService("action");
20
23
  this.router = useService("router");
21
24
  this.activeActions = this.props.archInfo.activeActions;
22
- this.model.addEventListener("update", () => this.selectRecord(), {once: true});
25
+ useBus(this.model.bus, "update", () => {
26
+ this.selectRecord();
27
+ });
28
+ onWillStart(() => {
29
+ this.updateJournalInfo();
30
+ });
31
+ onMounted(() => {
32
+ this.selectRecord();
33
+ });
34
+ }
35
+ get journalId() {
36
+ if (this.props.resModel === "account.bank.statement.line") {
37
+ return this.props.context.active_id;
38
+ }
39
+ return false;
40
+ }
41
+ async updateJournalInfo() {
42
+ var journalId = this.journalId;
43
+ if (!journalId) {
44
+ return;
45
+ }
46
+ var result = await this.orm.call("account.journal", "read", [
47
+ [journalId],
48
+ ["current_statement_balance", "currency_id", "company_currency_id"],
49
+ ]);
50
+ this.state.journalBalance = result[0].current_statement_balance;
51
+ this.state.currency = (result[0].currency_id ||
52
+ result[0].company_currency_id)[0];
53
+ }
54
+ get journalBalanceStr() {
55
+ if (!this.state.journalBalance) {
56
+ return "";
57
+ }
58
+ return formatMonetary(this.state.journalBalance, {
59
+ currencyId: this.state.currency,
60
+ });
23
61
  }
24
62
  exposeController(controller) {
25
63
  this.form_controller = controller;
@@ -45,6 +83,7 @@ export class ReconcileController extends KanbanController {
45
83
  return {
46
84
  resId: this.state.selectedRecordId,
47
85
  type: "form",
86
+ noBreadcrumbs: true,
48
87
  context: {
49
88
  ...(this.props.context || {}),
50
89
  form_view_ref: this.props.context.view_ref,
@@ -55,7 +94,7 @@ export class ReconcileController extends KanbanController {
55
94
  };
56
95
  }
57
96
  async selectRecord(record) {
58
- var resId = undefined;
97
+ var resId = false;
59
98
  if (record === undefined && this.props.resId) {
60
99
  resId = this.props.resId;
61
100
  } else if (record === undefined) {
@@ -97,6 +136,7 @@ export class ReconcileController extends KanbanController {
97
136
  this.router.pushState({id: resId});
98
137
  }
99
138
  }
139
+
100
140
  ReconcileController.components = {
101
141
  ...ReconcileController.components,
102
142
  View,
@@ -2,7 +2,58 @@
2
2
 
3
3
  import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
4
4
  import {ReconcileKanbanRecord} from "./reconcile_kanban_record.esm.js";
5
- export class ReconcileRenderer extends KanbanRenderer {}
5
+ import {formatMonetary} from "@web/views/fields/formatters";
6
+ import {useService} from "@web/core/utils/hooks";
7
+
8
+ export class ReconcileRenderer extends KanbanRenderer {
9
+ setup() {
10
+ super.setup();
11
+ this.action = useService("action");
12
+ this.orm = useService("orm");
13
+ }
14
+ getAggregates() {
15
+ if (
16
+ this.env.parentController.props.resModel !== "account.bank.statement.line"
17
+ ) {
18
+ return [];
19
+ }
20
+ const {list} = this.props;
21
+ const aggregates = [];
22
+ for (const record of list.records) {
23
+ const aggregateId = record.data.aggregate_id && record.data.aggregate_id;
24
+ if (
25
+ aggregateId &&
26
+ (!aggregates.length || aggregates[0].id !== aggregateId)
27
+ ) {
28
+ aggregates.push({
29
+ id: aggregateId,
30
+ name: record.data.aggregate_name,
31
+ balance: record.data.statement_balance_end_real,
32
+ balanceStr: formatMonetary(record.data.statement_balance_end_real, {
33
+ currencyId: record.data.currency_id[0],
34
+ }),
35
+ });
36
+ }
37
+ }
38
+ return aggregates;
39
+ }
40
+ async onClickStatement(statementId) {
41
+ const action = await this.orm.call(
42
+ "account.bank.statement",
43
+ "action_open_statement",
44
+ [[statementId]],
45
+ {
46
+ context: this.props.context,
47
+ }
48
+ );
49
+ const model = this.props.list.model;
50
+ this.action.doAction(action, {
51
+ async onClose() {
52
+ model.root.load();
53
+ },
54
+ });
55
+ }
56
+ }
6
57
 
7
58
  ReconcileRenderer.components = {
8
59
  ...KanbanRenderer.components,
@@ -17,6 +17,9 @@ export class ReconcileFormController extends FormController {
17
17
  afterExecuteAction: this.afterExecuteActionButton.bind(this),
18
18
  });
19
19
  }
20
+ displayName() {
21
+ return this.env.config.getDisplayName();
22
+ }
20
23
  async reloadFormController() {
21
24
  var is_reconciled = this.model.root.data.is_reconciled;
22
25
  await this.model.root.load();
@@ -15,6 +15,9 @@ export class ReconcileManualController extends FormController {
15
15
  afterExecuteAction: this.afterExecuteActionButton.bind(this),
16
16
  });
17
17
  }
18
+ displayName() {
19
+ return this.env.config.getDisplayName();
20
+ }
18
21
  async reloadFormController() {
19
22
  try {
20
23
  await this.model.root.load();
@@ -10,7 +10,7 @@ export class ReconcileMoveLineRenderer extends ListRenderer {
10
10
  record.resId
11
11
  )
12
12
  ) {
13
- classes += " o_field_account_reconcile_oca_move_line_selected";
13
+ classes += " o_field_account_reconcile_oca_move_line_selected table-info";
14
14
  }
15
15
  return classes;
16
16
  }
@@ -1,15 +1,22 @@
1
1
  /** @odoo-module **/
2
2
 
3
- import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
3
+ // import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
4
+ // import {Chatter} from "@mail/core/web/chatter";
4
5
  import {registry} from "@web/core/registry";
6
+ import {standardFieldProps} from "@web/views/fields/standard_field_props";
7
+ import {Chatter} from "@mail/core/web/chatter";
5
8
 
6
9
  const {Component} = owl;
7
10
 
8
11
  export class AccountReconcileChatterWidget extends Component {}
12
+ AccountReconcileChatterWidget.props = {...standardFieldProps};
9
13
  AccountReconcileChatterWidget.template =
10
14
  "account_reconcile_oca.AccountReconcileChatterWidget";
11
- AccountReconcileChatterWidget.components = {...Component.components, ChatterContainer};
12
-
15
+ AccountReconcileChatterWidget.components = {...Component.components, Chatter};
16
+ export const AccountReconcileChatterWidgetField = {
17
+ component: AccountReconcileChatterWidget,
18
+ supportedTypes: [],
19
+ };
13
20
  registry
14
21
  .category("fields")
15
- .add("account_reconcile_oca_chatter", AccountReconcileChatterWidget);
22
+ .add("account_reconcile_oca_chatter", AccountReconcileChatterWidgetField);
@@ -1,8 +1,7 @@
1
1
  /** @odoo-module **/
2
-
3
- import fieldUtils from "web.field_utils";
2
+ import {formatDate, parseDate} from "@web/core/l10n/dates";
3
+ import {formatMonetary} from "@web/views/fields/formatters";
4
4
  import {registry} from "@web/core/registry";
5
- import session from "web.session";
6
5
 
7
6
  const {Component} = owl;
8
7
 
@@ -22,45 +21,31 @@ export class AccountReconcileDataWidget extends Component {
22
21
  getReconcileLines() {
23
22
  var data = this.props.record.data[this.props.name].data;
24
23
  for (var line in data) {
25
- data[line].amount_format = fieldUtils.format.monetary(
26
- data[line].amount,
27
- undefined,
28
- {
29
- currency: session.get_currency(data[line].currency_id),
30
- }
31
- );
32
- data[line].debit_format = fieldUtils.format.monetary(
33
- data[line].debit,
34
- undefined,
35
- {
36
- currency: session.get_currency(data[line].currency_id),
37
- }
38
- );
39
- data[line].credit_format = fieldUtils.format.monetary(
40
- data[line].credit,
41
- undefined,
42
- {
43
- currency: session.get_currency(data[line].currency_id),
44
- }
45
- );
46
- data[line].amount_currency_format = fieldUtils.format.monetary(
24
+ data[line].amount_format = formatMonetary(data[line].amount, {
25
+ currencyId: data[line].currency_id,
26
+ });
27
+ data[line].debit_format = formatMonetary(data[line].debit, {
28
+ currencyId: data[line].currency_id,
29
+ });
30
+ data[line].credit_format = formatMonetary(data[line].credit, {
31
+ currencyId: data[line].currency_id,
32
+ });
33
+ data[line].amount_currency_format = formatMonetary(
47
34
  data[line].currency_amount,
48
- undefined,
49
35
  {
50
- currency: session.get_currency(data[line].line_currency_id),
36
+ currencyId: data[line].line_currency_id,
51
37
  }
52
38
  );
53
39
  if (data[line].original_amount) {
54
- data[line].original_amount_format = fieldUtils.format.monetary(
40
+ data[line].original_amount_format = formatMonetary(
55
41
  data[line].original_amount,
56
- undefined,
57
42
  {
58
- currency: session.get_currency(data[line].currency_id),
43
+ currencyId: data[line].currency_id,
59
44
  }
60
45
  );
61
46
  }
62
- data[line].date_format = fieldUtils.format.date(
63
- fieldUtils.parse.date(data[line].date, undefined, {isUTC: true})
47
+ data[line].date_format = formatDate(
48
+ parseDate(data[line].date, undefined, {isUTC: true})
64
49
  );
65
50
  }
66
51
  return data;
@@ -86,6 +71,10 @@ export class AccountReconcileDataWidget extends Component {
86
71
  }
87
72
  AccountReconcileDataWidget.template = "account_reconcile_oca.ReconcileDataWidget";
88
73
 
74
+ export const AccountReconcileDataWidgetField = {
75
+ component: AccountReconcileDataWidget,
76
+ supportedTypes: [],
77
+ };
89
78
  registry
90
79
  .category("fields")
91
- .add("account_reconcile_oca_data", AccountReconcileDataWidget);
80
+ .add("account_reconcile_oca_data", AccountReconcileDataWidgetField);
@@ -1,19 +1,29 @@
1
1
  /** @odoo-module **/
2
2
 
3
3
  import {View} from "@web/views/view";
4
+ import {evaluateBooleanExpr} from "@web/core/py_js/py";
5
+ import {getFieldContext} from "@web/model/relational_model/utils";
4
6
  import {registry} from "@web/core/registry";
7
+ import {standardFieldProps} from "@web/views/fields/standard_field_props";
5
8
 
6
9
  const {Component, useSubEnv} = owl;
7
10
 
8
11
  export class AccountReconcileMatchWidget extends Component {
9
12
  setup() {
10
13
  // Necessary in order to avoid a loop
11
- super.setup(...arguments);
12
14
  useSubEnv({
13
15
  config: {},
14
16
  parentController: this.env.parentController,
15
17
  });
16
18
  }
19
+
20
+ getDomain() {
21
+ let domain = this.props.domain;
22
+ if (typeof domain === "function") {
23
+ domain = domain();
24
+ }
25
+ return domain;
26
+ }
17
27
  get listViewProperties() {
18
28
  return {
19
29
  type: "list",
@@ -22,15 +32,18 @@ export class AccountReconcileMatchWidget extends Component {
22
32
  // Hiding the control panel buttons
23
33
  "top-left": false,
24
34
  "bottom-left": false,
35
+ layoutActions: false,
25
36
  },
26
37
  },
38
+ noBreadcrumbs: true,
27
39
  resModel: this.props.record.fields[this.props.name].relation,
28
40
  searchMenuTypes: ["filter"],
29
- domain: this.props.record.getFieldDomain(this.props.name).toList(),
41
+ domain: this.getDomain(),
30
42
  context: {
31
- ...this.props.record.getFieldContext(this.props.name),
43
+ ...this.props.context,
44
+ ...getFieldContext(this.props.record, this.props.name),
32
45
  },
33
- // Disables de selector
46
+ // Disables selector
34
47
  allowSelectors: false,
35
48
  // We need to force the search view in order to show the right one
36
49
  searchViewId: false,
@@ -39,13 +52,56 @@ export class AccountReconcileMatchWidget extends Component {
39
52
  };
40
53
  }
41
54
  }
55
+ AccountReconcileMatchWidget.props = {
56
+ ...standardFieldProps,
57
+ placeholder: {type: String, optional: true},
58
+ canOpen: {type: Boolean, optional: true},
59
+ canCreate: {type: Boolean, optional: true},
60
+ canWrite: {type: Boolean, optional: true},
61
+ canQuickCreate: {type: Boolean, optional: true},
62
+ canCreateEdit: {type: Boolean, optional: true},
63
+ context: {type: String, optional: true},
64
+ domain: {type: [Array, Function], optional: true},
65
+ nameCreateField: {type: String, optional: true},
66
+ searchLimit: {type: Number, optional: true},
67
+ relation: {type: String, optional: true},
68
+ string: {type: String, optional: true},
69
+ canScanBarcode: {type: Boolean, optional: true},
70
+ update: {type: Function, optional: true},
71
+ value: {optional: true},
72
+ decorations: {type: Object, optional: true},
73
+ };
42
74
  AccountReconcileMatchWidget.template = "account_reconcile_oca.ReconcileMatchWidget";
43
-
44
75
  AccountReconcileMatchWidget.components = {
45
76
  ...AccountReconcileMatchWidget.components,
46
77
  View,
47
78
  };
48
79
 
80
+ export const AccountReconcileMatchWidgetField = {
81
+ component: AccountReconcileMatchWidget,
82
+ supportedTypes: [],
83
+ extractProps({attrs, context, decorations, options}, dynamicInfo) {
84
+ const hasCreatePermission = attrs.can_create
85
+ ? evaluateBooleanExpr(attrs.can_create)
86
+ : true;
87
+ const hasWritePermission = attrs.can_write
88
+ ? evaluateBooleanExpr(attrs.can_write)
89
+ : true;
90
+ const canCreate = options.no_create ? false : hasCreatePermission;
91
+ return {
92
+ placeholder: attrs.placeholder,
93
+ canOpen: !options.no_open,
94
+ canCreate,
95
+ canWrite: hasWritePermission,
96
+ canQuickCreate: canCreate && !options.no_quick_create,
97
+ canCreateEdit: canCreate && !options.no_create_edit,
98
+ context: context,
99
+ decorations,
100
+ domain: dynamicInfo.domain,
101
+ };
102
+ },
103
+ };
104
+
49
105
  registry
50
106
  .category("fields")
51
- .add("account_reconcile_oca_match", AccountReconcileMatchWidget);
107
+ .add("account_reconcile_oca_match", AccountReconcileMatchWidgetField);
@@ -4,6 +4,7 @@ import {
4
4
  preloadSelection,
5
5
  } from "@web/views/fields/badge_selection/badge_selection_field";
6
6
  import {registry} from "@web/core/registry";
7
+ import {standardFieldProps} from "@web/views/fields/standard_field_props";
7
8
 
8
9
  export class FieldSelectionBadgeUncheck extends BadgeSelectionField {
9
10
  async onChange(value) {
@@ -19,9 +20,17 @@ export class FieldSelectionBadgeUncheck extends BadgeSelectionField {
19
20
  }
20
21
  }
21
22
 
23
+ FieldSelectionBadgeUncheck.props = {...standardFieldProps};
22
24
  FieldSelectionBadgeUncheck.supportedTypes = ["many2one", "selection"];
23
25
  FieldSelectionBadgeUncheck.additionalClasses = ["o_field_selection_badge"];
24
- registry.category("fields").add("selection_badge_uncheck", FieldSelectionBadgeUncheck);
26
+
27
+ export const FieldSelectionBadgeUncheckField = {
28
+ component: FieldSelectionBadgeUncheck,
29
+ supportedTypes: ["many2one"],
30
+ };
31
+ registry
32
+ .category("fields")
33
+ .add("selection_badge_uncheck", FieldSelectionBadgeUncheckField);
25
34
 
26
35
  registry.category("preloadedData").add("selection_badge_uncheck", {
27
36
  loadOnTypes: ["many2one"],
@@ -6,7 +6,23 @@
6
6
  flex-flow: row wrap;
7
7
  height: 100%;
8
8
  .o_kanban_renderer.o_kanban_ungrouped .o_kanban_record {
9
+ &:hover {
10
+ .o_reconcile_create_statement {
11
+ opacity: 100;
12
+ }
13
+ }
9
14
  margin: 0 0 0;
15
+ min-width: fit-content;
16
+ width: 100%;
17
+ .o_reconcile_create_statement {
18
+ position: absolute;
19
+ height: 4px;
20
+ margin: 0;
21
+ padding: 2px 0 0 0;
22
+ border: 0;
23
+ top: -14px;
24
+ opacity: 0;
25
+ }
10
26
  > div {
11
27
  border-right: thick solid rgba(0, 0, 0, 0);
12
28
  }
@@ -26,23 +42,8 @@
26
42
  height: 100%;
27
43
  }
28
44
  .o_form_view {
29
- .btn-info:not(.dropdown-toggle):not(.dropdown-item) {
30
- text-transform: uppercase;
31
- }
32
45
  .o_form_statusbar.o_account_reconcile_oca_statusbar {
33
- .btn:not(.dropdown-toggle):not(.dropdown-item) {
34
- text-transform: uppercase;
35
- }
36
46
  height: 40px;
37
- > .o_statusbar_buttons {
38
- height: 100%;
39
- > .btn {
40
- margin: 0;
41
- height: 100%;
42
- padding: 10px;
43
- border-radius: 0;
44
- }
45
- }
46
47
  }
47
48
  .o_field_account_reconcile_oca_data {
48
49
  .o_field_account_reconcile_oca_balance_float {
@@ -4,8 +4,44 @@
4
4
  t-name="account_reconcile_oca.ReconcileRenderer"
5
5
  t-inherit="web.KanbanRenderer"
6
6
  t-inherit-mode="primary"
7
- owl="1"
8
7
  >
8
+ <xpath expr="//t[@t-as='groupOrRecord']" position="before">
9
+ <div class="m-2 d-flex w-100" t-if="env.parentController.journalId">
10
+ <span
11
+ class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
12
+ >Global Balance</span>
13
+ <span
14
+ class="pe-0 fw-bold fs-4 align-self-center"
15
+ t-esc="env.parentController.journalBalanceStr"
16
+ />
17
+ </div>
18
+ <t t-set="aggregates" t-value="getAggregates()" />
19
+ </xpath>
20
+ <xpath expr="//t[@t-else='']/KanbanRecord" position="before">
21
+ <t
22
+ t-if="aggregates.length and groupOrRecord.record.data.aggregate_id and aggregates[0].id == groupOrRecord.record.data.aggregate_id"
23
+ >
24
+ <t t-set="aggregate" t-value="aggregates.shift()" />
25
+ <div class="m-2 d-flex w-100">
26
+ <span
27
+ class="flex-fill text-900 text-start ps-0 fw-bold fs-4 align-self-center"
28
+ t-esc="aggregate.name"
29
+ />
30
+ <span
31
+ t-if="groupOrRecord.record.data.reconcile_aggregate == 'statement'"
32
+ t-on-click="() => this.onClickStatement(aggregate.id)"
33
+ class="pe-0 fw-bold fs-4 align-self-center btn btn-link"
34
+ t-esc="aggregate.balanceStr"
35
+ />
36
+ <!--
37
+ <span
38
+ t-if="groupOrRecord.record.data.reconcile_aggregate != 'statement'"
39
+ class="pe-0 fw-bold fs-4 align-self-center text-link"
40
+ t-esc="aggregate.balanceStr"
41
+ />-->
42
+ </div>
43
+ </t>
44
+ </xpath>
9
45
  <xpath expr="div[hasclass('o_kanban_renderer')]" position="attributes">
10
46
  <attribute
11
47
  name="class"
@@ -23,7 +59,6 @@
23
59
  t-name="account_reconcile_oca.ReconcileController"
24
60
  t-inherit="web.KanbanView"
25
61
  t-inherit-mode="primary"
26
- owl="1"
27
62
  >
28
63
  <!-- we pass to the component the selected record -->
29
64
  <xpath expr="//Layout/t[2]" position="attributes">
@@ -42,17 +77,17 @@
42
77
  </div>
43
78
  </xpath>
44
79
  </t>
45
- <t t-name="account_reconcile.ReconcileView.Buttons" owl="1">
80
+ <t t-name="account_reconcile.ReconcileView.Buttons">
46
81
  <button
47
82
  t-on-click="onClickNewButton"
48
83
  class="btn btn-primary"
49
84
  t-if="activeActions.create"
50
85
  >Create</button>
51
86
  </t>
52
- <t t-name="account_reconcile_oca.ReconcileMatchWidget" owl="1">
53
- <View t-props="listViewProperties" />
87
+ <t t-name="account_reconcile_oca.ReconcileMatchWidget">
88
+ <View t-props="this.listViewProperties" />
54
89
  </t>
55
- <t t-name="account_reconcile_oca.ReconcileDataWidget" owl="1">
90
+ <t t-name="account_reconcile_oca.ReconcileDataWidget">
56
91
  <table
57
92
  class="table table-sm position-relative mb-0 table-striped o_reconcile_widget_table"
58
93
  style="table-layout: auto"
@@ -138,17 +173,16 @@
138
173
  </tbody>
139
174
  </table>
140
175
  </t>
141
- <t t-name="account_reconcile_oca.AccountReconcileChatterWidget" owl="1">
142
- <ChatterContainer
176
+ <t t-name="account_reconcile_oca.AccountReconcileChatterWidget">
177
+ <Chatter
143
178
  threadModel="this.props.record.fields[this.props.name].relation"
144
- threadId="this.props.value[0]"
179
+ threadId="this.props.record.data[this.props.name][0]"
145
180
  />
146
181
  </t>
147
182
  <t
148
183
  t-name="account_reconcile_oca.ReconcileMoveLineController"
149
184
  t-inherit="web.ListView"
150
185
  t-inherit-mode="primary"
151
- owl="1"
152
186
  >
153
187
  <xpath expr="//t[@list='model.root']" position="attributes">
154
188
  <attribute name="parentRecord">props.parentRecord</attribute>