Skip to content

Commit b2291db

Browse files
authored
Merge pull request #3120 from ForgeFlow/13.0-update-upstream-9a8319b2b71
[13.0] update upstream 9a8319b
2 parents ee7e1d8 + eac0c0e commit b2291db

File tree

95 files changed

+2584
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2584
-427
lines changed

.tx/config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ file_filter = addons/fetchmail/i18n/<lang>.po
227227
source_file = addons/fetchmail/i18n/fetchmail.pot
228228
source_lang = en
229229

230+
[odoo-13.fetchmail_gmail]
231+
file_filter = addons/fetchmail_gmail/i18n/<lang>.po
232+
source_file = addons/fetchmail_gmail/i18n/fetchmail_gmail.pot
233+
source_lang = en
234+
230235
[odoo-13.fleet]
231236
file_filter = addons/fleet/i18n/<lang>.po
232237
source_file = addons/fleet/i18n/fleet.pot
@@ -257,6 +262,11 @@ file_filter = addons/google_drive/i18n/<lang>.po
257262
source_file = addons/google_drive/i18n/google_drive.pot
258263
source_lang = en
259264

265+
[odoo-13.google_gmail]
266+
file_filter = addons/google_gmail/i18n/<lang>.po
267+
source_file = addons/google_gmail/i18n/google_gmail.pot
268+
source_lang = en
269+
260270
[odoo-13.google_spreadsheet]
261271
file_filter = addons/google_spreadsheet/i18n/<lang>.po
262272
source_file = addons/google_spreadsheet/i18n/google_spreadsheet.pot

addons/account/models/account_move.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ def _onchange_partner_id(self):
348348
if self.is_sale_document(include_receipts=True) and self.partner_id:
349349
self.invoice_payment_term_id = self.partner_id.property_payment_term_id or self.invoice_payment_term_id
350350
new_term_account = self.partner_id.commercial_partner_id.property_account_receivable_id
351+
self.narration = self.company_id.with_context(lang=self.partner_id.lang).invoice_terms
351352
elif self.is_purchase_document(include_receipts=True) and self.partner_id:
352353
self.invoice_payment_term_id = self.partner_id.property_supplier_payment_term_id or self.invoice_payment_term_id
353354
new_term_account = self.partner_id.commercial_partner_id.property_account_payable_id
@@ -785,6 +786,7 @@ def _apply_cash_rounding(self, diff_balance, diff_amount_currency, cash_rounding
785786
'name': _('%s (rounding)') % biggest_tax_line.name,
786787
'account_id': biggest_tax_line.account_id.id,
787788
'tax_repartition_line_id': biggest_tax_line.tax_repartition_line_id.id,
789+
'tag_ids': [(6, 0, biggest_tax_line.tag_ids.ids)],
788790
'tax_exigible': biggest_tax_line.tax_exigible,
789791
'exclude_from_invoice_tab': True,
790792
})
@@ -1312,7 +1314,7 @@ def _compute_payments_widget_to_reconcile_info(self):
13121314
pay_term_line_ids = move.line_ids.filtered(lambda line: line.account_id.user_type_id.type in ('receivable', 'payable'))
13131315

13141316
domain = [('account_id', 'in', pay_term_line_ids.mapped('account_id').ids),
1315-
'|', ('move_id.state', '=', 'posted'), '&', ('move_id.state', '=', 'draft'), ('journal_id.post_at', '=', 'bank_rec'),
1317+
'|', ('parent_state', '=', 'posted'), '&', ('parent_state', '=', 'draft'), ('journal_id.post_at', '=', 'bank_rec'),
13161318
('partner_id', '=', move.commercial_partner_id.id),
13171319
('reconciled', '=', False), '|', ('amount_residual', '!=', 0.0),
13181320
('amount_residual_currency', '!=', 0.0)]
@@ -3460,7 +3462,7 @@ def _affect_tax_report(self):
34603462
return self.tax_ids or self.tax_line_id or self.tag_ids.filtered(lambda x: x.applicability == "taxes")
34613463

34623464
def _check_tax_lock_date(self):
3463-
for line in self.filtered(lambda l: l.move_id.state == 'posted'):
3465+
for line in self.filtered(lambda l: l.parent_state == 'posted'):
34643466
move = line.move_id
34653467
if move.company_id.tax_lock_date and move.date <= move.company_id.tax_lock_date and line._affect_tax_report():
34663468
raise UserError(_("The operation is refused as it would impact an already issued tax statement. "
@@ -4314,7 +4316,7 @@ def _query_get(self, domain=None):
43144316

43154317
state = context.get('state')
43164318
if state and state.lower() != 'all':
4317-
domain += [('move_id.state', '=', state)]
4319+
domain += [('parent_state', '=', state)]
43184320

43194321
if context.get('company_id'):
43204322
domain += [('company_id', '=', context['company_id'])]
@@ -4348,7 +4350,7 @@ def _query_get(self, domain=None):
43484350
tables = ''
43494351
if domain:
43504352
domain.append(('display_type', 'not in', ('line_section', 'line_note')))
4351-
domain.append(('move_id.state', '!=', 'cancel'))
4353+
domain.append(('parent_state', '!=', 'cancel'))
43524354

43534355
query = self._where_calc(domain)
43544356

addons/account/static/src/js/reconciliation/reconciliation_model.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ var StatementModel = BasicModel.extend({
149149

150150
return Promise.all([
151151
this._computeLine(line),
152-
this._performMoveLine(handle, 'match_rp', line.mode == 'match_rp'? 1 : 0),
153-
this._performMoveLine(handle, 'match_other', line.mode == 'match_other'? 1 : 0)
152+
this._performMoveLine(handle, line.mode, 1)
154153
]);
155154
},
156155
/**
@@ -1208,7 +1207,7 @@ var StatementModel = BasicModel.extend({
12081207
line['mv_lines_'+mode] = _.uniq(line['mv_lines_'+mode].concat(mv_lines), l => l.id);
12091208
if (mv_lines[0]){
12101209
line['remaining_'+mode] = mv_lines[0].recs_count - mv_lines.length;
1211-
} else if (line['mv_lines_'+mode].lenght == 0) {
1210+
} else if (line['mv_lines_'+mode].length == 0) {
12121211
line['remaining_'+mode] = 0;
12131212
}
12141213
this._formatLineProposition(line, mv_lines);
@@ -1884,6 +1883,11 @@ var ManualModel = StatementModel.extend({
18841883
var self = this;
18851884
var line = this.getLine(handle);
18861885
line.mv_lines_match = _.uniq((line.mv_lines_match || []).concat(mv_lines), l => l.id);
1886+
if (mv_lines[0]){
1887+
line.remaining_match = mv_lines[0].recs_count - mv_lines.length;
1888+
} else if (line.mv_lines_match.length == 0) {
1889+
line.remaining_match = 0;
1890+
}
18871891
this._formatLineProposition(line, mv_lines);
18881892

18891893
if (line.mode !== 'create' && !line.mv_lines_match.length && !line.filter_match.length) {

addons/account/tests/test_account_move_in_invoice.py

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ def test_in_invoice_line_onchange_taxes_1(self):
811811
})
812812

813813
def test_in_invoice_line_onchange_cash_rounding_1(self):
814+
# Test 'add_invoice_line' rounding
814815
move_form = Form(self.invoice)
815816
# Add a cash rounding having 'add_invoice_line'.
816817
move_form.invoice_cash_rounding_id = self.cash_rounding_a
@@ -864,22 +865,69 @@ def test_in_invoice_line_onchange_cash_rounding_1(self):
864865
self.term_line_vals_1,
865866
], self.move_vals)
866867

867-
move_form = Form(self.invoice)
868-
# Change the cash rounding to one having 'biggest_tax'.
869-
move_form.invoice_cash_rounding_id = self.cash_rounding_b
870-
move_form.save()
868+
# Test 'biggest_tax' rounding
871869

872-
self.assertInvoiceValues(self.invoice, [
870+
self.company_data['company'].country_id = self.env.ref('base.us')
871+
872+
# Add a tag to product_a's default tax
873+
tax_line_tag = self.env['account.account.tag'].create({
874+
'name': "Tax tag",
875+
'applicability': 'taxes',
876+
'country_id': self.company_data['company'].country_id.id,
877+
})
878+
879+
repartition_line = self.tax_purchase_a.invoice_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax')
880+
repartition_line.write({'tag_ids': [(4, tax_line_tag.id, 0)]})
881+
882+
# Create the invoice
883+
biggest_tax_invoice = self.env['account.move'].create({
884+
'type': 'in_invoice',
885+
'invoice_date': '2019-01-01',
886+
'partner_id': self.partner_a.id,
887+
'invoice_cash_rounding_id': self.cash_rounding_b.id,
888+
'invoice_payment_term_id': self.pay_terms_a.id,
889+
'invoice_line_ids': [
890+
(0, 0, {
891+
'product_id': self.product_a.id,
892+
'price_unit': 799.99,
893+
'tax_ids': [(6, 0, self.product_a.supplier_taxes_id.ids)],
894+
'product_uom_id': self.product_a.uom_id.id,
895+
}),
896+
897+
(0, 0, {
898+
'product_id': self.product_b.id,
899+
'price_unit': self.product_b.standard_price,
900+
'tax_ids': [(6, 0, self.product_b.supplier_taxes_id.ids)],
901+
'product_uom_id': self.product_b.uom_id.id,
902+
}),
903+
],
904+
})
905+
906+
self.assertInvoiceValues(biggest_tax_invoice, [
873907
{
874908
**self.product_line_vals_1,
875909
'price_unit': 799.99,
876910
'price_subtotal': 799.99,
877911
'price_total': 919.99,
878912
'debit': 799.99,
913+
'tax_repartition_line_id': None,
914+
'tag_ids': [],
915+
},
916+
{
917+
**self.product_line_vals_2,
918+
'tax_repartition_line_id': None,
919+
'tag_ids': [],
920+
},
921+
{
922+
**self.tax_line_vals_1,
923+
'tax_repartition_line_id': repartition_line.id,
924+
'tag_ids': tax_line_tag.ids,
925+
},
926+
{
927+
**self.tax_line_vals_2,
928+
'tax_repartition_line_id': self.tax_purchase_b.invoice_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax').id,
929+
'tag_ids': [],
879930
},
880-
self.product_line_vals_2,
881-
self.tax_line_vals_1,
882-
self.tax_line_vals_2,
883931
{
884932
'name': '%s (rounding)' % self.tax_purchase_a.name,
885933
'product_id': False,
@@ -893,6 +941,8 @@ def test_in_invoice_line_onchange_cash_rounding_1(self):
893941
'price_total': -0.04,
894942
'tax_ids': [],
895943
'tax_line_id': self.tax_purchase_a.id,
944+
'tax_repartition_line_id': repartition_line.id,
945+
'tag_ids': tax_line_tag.ids,
896946
'currency_id': False,
897947
'amount_currency': 0.0,
898948
'debit': 0.0,
@@ -906,6 +956,8 @@ def test_in_invoice_line_onchange_cash_rounding_1(self):
906956
'price_subtotal': -1127.95,
907957
'price_total': -1127.95,
908958
'credit': 1127.95,
959+
'tax_repartition_line_id': None,
960+
'tag_ids': [],
909961
},
910962
], {
911963
**self.move_vals,

addons/account/tests/test_account_move_in_refund.py

Lines changed: 60 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ def test_in_refund_line_onchange_taxes_1(self):
523523
})
524524

525525
def test_in_refund_line_onchange_cash_rounding_1(self):
526+
# Test 'add_invoice_line' rounding
526527
move_form = Form(self.invoice)
527528
# Add a cash rounding having 'add_invoice_line'.
528529
move_form.invoice_cash_rounding_id = self.cash_rounding_a
@@ -576,22 +577,69 @@ def test_in_refund_line_onchange_cash_rounding_1(self):
576577
self.term_line_vals_1,
577578
], self.move_vals)
578579

579-
move_form = Form(self.invoice)
580-
# Change the cash rounding to one having 'biggest_tax'.
581-
move_form.invoice_cash_rounding_id = self.cash_rounding_b
582-
move_form.save()
580+
# Test 'biggest_tax' rounding
583581

584-
self.assertInvoiceValues(self.invoice, [
582+
self.company_data['company'].country_id = self.env.ref('base.us')
583+
584+
# Add a tag to product_a's default tax
585+
tax_line_tag = self.env['account.account.tag'].create({
586+
'name': "Tax tag",
587+
'applicability': 'taxes',
588+
'country_id': self.company_data['company'].country_id.id,
589+
})
590+
591+
repartition_line = self.tax_purchase_a.refund_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax')
592+
repartition_line.write({'tag_ids': [(4, tax_line_tag.id, 0)]})
593+
594+
# Create the invoice
595+
biggest_tax_invoice = self.env['account.move'].create({
596+
'type': 'in_refund',
597+
'invoice_date': '2019-01-01',
598+
'partner_id': self.partner_a.id,
599+
'invoice_cash_rounding_id': self.cash_rounding_b.id,
600+
'invoice_payment_term_id': self.pay_terms_a.id,
601+
'invoice_line_ids': [
602+
(0, 0, {
603+
'product_id': self.product_a.id,
604+
'price_unit': 799.99,
605+
'tax_ids': [(6, 0, self.product_a.supplier_taxes_id.ids)],
606+
'product_uom_id': self.product_a.uom_id.id,
607+
}),
608+
609+
(0, 0, {
610+
'product_id': self.product_b.id,
611+
'price_unit': self.product_b.standard_price,
612+
'tax_ids': [(6, 0, self.product_b.supplier_taxes_id.ids)],
613+
'product_uom_id': self.product_b.uom_id.id,
614+
}),
615+
],
616+
})
617+
618+
self.assertInvoiceValues(biggest_tax_invoice, [
585619
{
586620
**self.product_line_vals_1,
587621
'price_unit': 799.99,
588622
'price_subtotal': 799.99,
589623
'price_total': 919.99,
590624
'credit': 799.99,
625+
'tax_repartition_line_id': None,
626+
'tag_ids': [],
627+
},
628+
{
629+
**self.product_line_vals_2,
630+
'tax_repartition_line_id': None,
631+
'tag_ids': [],
632+
},
633+
{
634+
**self.tax_line_vals_1,
635+
'tax_repartition_line_id': repartition_line.id,
636+
'tag_ids': tax_line_tag.ids,
637+
},
638+
{
639+
**self.tax_line_vals_2,
640+
'tax_repartition_line_id': self.tax_purchase_b.refund_repartition_line_ids.filtered(lambda x: x.repartition_type == 'tax').id,
641+
'tag_ids': [],
591642
},
592-
self.product_line_vals_2,
593-
self.tax_line_vals_1,
594-
self.tax_line_vals_2,
595643
{
596644
'name': '%s (rounding)' % self.tax_purchase_a.name,
597645
'product_id': False,
@@ -605,6 +653,8 @@ def test_in_refund_line_onchange_cash_rounding_1(self):
605653
'price_total': -0.04,
606654
'tax_ids': [],
607655
'tax_line_id': self.tax_purchase_a.id,
656+
'tax_repartition_line_id': repartition_line.id,
657+
'tag_ids': tax_line_tag.ids,
608658
'currency_id': False,
609659
'amount_currency': 0.0,
610660
'debit': 0.04,
@@ -618,6 +668,8 @@ def test_in_refund_line_onchange_cash_rounding_1(self):
618668
'price_subtotal': -1127.95,
619669
'price_total': -1127.95,
620670
'debit': 1127.95,
671+
'tax_repartition_line_id': None,
672+
'tag_ids': [],
621673
},
622674
], {
623675
**self.move_vals,

0 commit comments

Comments
 (0)