Permalink
Browse files

[MERGE] forward port branch 11.0 up to e5c8071

  • Loading branch information...
KangOl committed Nov 8, 2018
2 parents fe518f1 + e5c8071 commit 94a9fc990212667e1893104eeaa5bd95d4b2ebaa
@@ -394,9 +394,17 @@ var StatementModel = BasicModel.extend({
};
});
});
var domainReconcile = [];
if (context && context.company_ids) {
domainReconcile.push(['company_id', 'in', context.company_ids]);
}
if (context && context.active_model === 'account.journal' && context.active_ids) {
domainReconcile.push(['journal_id', 'in', [false].concat(context.active_ids)]);
}
var def_reconcileModel = this._rpc({
model: 'account.reconcile.model',
method: 'search_read',
domain: domainReconcile,
})
.then(function (reconcileModels) {
self.reconcileModels = reconcileModels;
@@ -1199,9 +1207,14 @@ var ManualModel = StatementModel.extend({
self.accounts = _.object(self.account_ids, _.pluck(accounts, 'code'));
});
var domainReconcile = [];
if (context && context.company_ids) {
domainReconcile.push(['company_id', 'in', context.company_ids]);
}
var def_reconcileModel = this._rpc({
model: 'account.reconcile.model',
method: 'search_read',
domain: domainReconcile,
})
.then(function (reconcileModels) {
self.reconcileModels = reconcileModels;
@@ -420,6 +420,32 @@ def test_payment_and_writeoff_in_other_currency_1(self):
self.assertTrue(payment.move_line_ids.filtered(lambda l: l.account_id == invoice.account_id)[0].full_reconcile_id)
self.assertEqual(invoice.state, 'paid')
def test_payment_and_writeoff_out_refund(self):
# Use case:
# Company is in EUR, create a credit note for 100 EUR and register payment of 90.
# Mark invoice as fully paid with a write_off
# Check that all the aml are correctly created.
invoice = self.create_invoice(amount=100, type='out_refund', currency_id=self.currency_eur_id, partner=self.partner_agrolait.id)
# register payment on invoice
payment = self.payment_model.create({'payment_type': 'outbound',
'payment_method_id': self.env.ref('account.account_payment_method_manual_in').id,
'partner_type': 'customer',
'partner_id': self.partner_agrolait.id,
'amount': 90,
'payment_date': time.strftime('%Y') + '-07-15',
'payment_difference_handling': 'reconcile',
'writeoff_account_id': self.account_payable.id,
'journal_id': self.bank_journal_euro.id,
'invoice_ids': [(4, invoice.id, None)]
})
payment.post()
self.check_journal_items(payment.move_line_ids, [
{'account_id': self.account_eur.id, 'debit': 0.0, 'credit': 90.0, 'amount_currency': 0.0, 'currency_id': False},
{'account_id': self.account_payable.id, 'debit': 0.0, 'credit': 10.0, 'amount_currency': 0.0, 'currency_id': False},
{'account_id': self.account_receivable.id, 'debit': 100.0, 'credit': 0.0, 'amount_currency': 0.0, 'currency_id': False},
])
self.assertEqual(invoice.state, 'paid')
def test_payment_and_writeoff_in_other_currency_2(self):
# Use case:
# Company is in EUR, create a supplier bill of 5325.6 USD and register payment of 5325 USD, at a different rate
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="account_reports_uk_statements_menu" name="England" parent="account.menu_finance_reports" sequence="0" groups="account.group_account_user"/>
<menuitem id="account_reports_uk_statements_menu" name="United Kingdom" parent="account.menu_finance_reports" sequence="0" groups="account.group_account_user"/>
<record id="transfer_account" model="account.account.template">
<field name="name">Transfer Account</field>
@@ -17,7 +17,7 @@ msgstr ""
#. module: l10n_uk
#: model:ir.ui.menu,name:l10n_uk.account_reports_uk_statements_menu
msgid "British Statements"
msgid "United Kindom"
msgstr ""
#. module: l10n_uk
@@ -28,7 +28,9 @@ var Followers = AbstractField.extend({
'click .o_remove_follower': '_onRemoveFollower',
'click .o_mail_redirect': '_onRedirect',
},
supportedFieldTypes: ['one2many'],
// this widget only supports one2many but is not generic enough to claim
// that it supports all one2many fields
// supportedFieldTypes: ['one2many'],
// inherited
init: function(parent, name, record, options) {
@@ -256,7 +256,7 @@
</group>
<notebook>
<page string="Detailed Operations" attrs="{'invisible': [('show_operations', '=', False)]}">
<field name="move_line_ids" attrs="{'readonly': [('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
<field name="move_line_ids" attrs="{'readonly': ['|', '&amp;', ('show_operations', '=', False), ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
<tree editable="bottom" decoration-muted="(state == 'done' and is_locked == True)" decoration-danger="qty_done&gt;product_uom_qty and state!='done'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
<field name="product_id" required="1" attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"/>
<field name="move_id" invisible="1"/>
@@ -40,10 +40,12 @@ def _compute_model_ids(self):
for wizard in self:
if wizard.module_id:
module_names = set(wizard._get_modules().mapped('name'))
# find the models that have all their XIDs in the given modules
def lost(model):
return all(xid.split('.')[0] in module_names
for xid in ir_models_xids.get(model.id, ()))
xids = ir_models_xids.get(model.id, ())
return xids and all(xid.split('.')[0] in module_names for xid in xids)
# find the models that have all their XIDs in the given modules
self.model_ids = ir_models.filtered(lost).sorted('name')
@api.onchange('module_id')

0 comments on commit 94a9fc9

Please sign in to comment.