diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-07-22 16:29:42 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-07-22 16:29:42 +0200 |
| commit | 67366dfb5e31eba8bc883069eb59cc311d9e25c3 (patch) | |
| tree | d5eca575ce087c5cb57401fc2b5b4521522a9590 /addons | |
| parent | 2cf91d16a5f844a2a3d5d22c025c180a6615bab8 (diff) | |
| parent | 8ac40acb0d9a234eb59e55c3bc8f1a9a75bc4469 (diff) | |
[MERGE] merge upstream branch.
Forward ports generates a lot of conflicts to resolve. Rebasing
(even with rerere) will force me to re-resolve most of the conflicts.
Diffstat (limited to 'addons')
24 files changed, 97 insertions, 124 deletions
diff --git a/addons/account/models/account.py b/addons/account/models/account.py index b66adefb388..611437a76c8 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -621,7 +621,7 @@ class AccountOperationTemplate(models.Model): name = fields.Char(string='Button Label', required=True) sequence = fields.Integer(required=True, default=10) - has_second_line = fields.Boolean(string='Second line', default=False) + has_second_line = fields.Boolean(string='Add a second line', default=False) company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.user.company_id) account_id = fields.Many2one('account.account', string='Account', ondelete='cascade', domain=[('deprecated', '=', False)]) @@ -629,7 +629,7 @@ class AccountOperationTemplate(models.Model): label = fields.Char(string='Journal Item Label') amount_type = fields.Selection([ ('fixed', 'Fixed'), - ('percentage', 'Percentage of amount') + ('percentage', 'Percentage of balance') ], required=True, default='percentage') amount = fields.Float(digits=0, required=True, default=100.0, help="Fixed amount will count as a debit if it is negative, as a credit if it is positive.") tax_id = fields.Many2one('account.tax', string='Tax', ondelete='restrict', domain=[('type_tax_use', '=', 'purchase')]) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index c568601370e..712efad80d7 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -98,6 +98,22 @@ class AccountBankStatement(models.Model): return journals[0] return False + @api.multi + def _set_opening_balance(self, journal_id): + last_bnk_stmt = self.search([('journal_id', '=', journal_id), ('state', '=', 'confirm')], order="date desc", limit=1) + for bank_stmt in self: + if last_bnk_stmt: + bank_stmt.balance_start = last_bnk_stmt.balance_end + else: + bank_stmt.balance_start = 0 + + @api.model + def _default_opening_balance(self): + #Search last bank statement and set current opening balance as closing balance of previous one + journal_id = self._context.get('default_journal_id', False) or self._context.get('journal_id', False) + if journal_id: + self._set_opening_balance(journal_id) + _name = "account.bank.statement" _description = "Bank Statement" _order = "date desc, id desc" @@ -106,7 +122,7 @@ class AccountBankStatement(models.Model): name = fields.Char(string='Reference', states={'open': [('readonly', False)]}, copy=False, readonly=True) date = fields.Date(required=True, states={'confirm': [('readonly', True)]}, select=True, copy=False, default=fields.Date.context_today) date_done = fields.Datetime(string="Closed On") - balance_start = fields.Monetary(string='Starting Balance', states={'confirm': [('readonly', True)]}) + balance_start = fields.Monetary(string='Starting Balance', states={'confirm': [('readonly', True)]}, default=_default_opening_balance) balance_end_real = fields.Monetary('Ending Balance', states={'confirm': [('readonly', True)]}) state = fields.Selection([('open', 'New'), ('confirm', 'Validated')], string='Status', required=True, readonly=True, copy=False, default='open') currency_id = fields.Many2one('res.currency', compute='_compute_currency', oldname='currency') @@ -127,6 +143,9 @@ class AccountBankStatement(models.Model): cashbox_end_id = fields.Many2one('account.bank.statement.cashbox') + @api.onchange('journal_id') + def onchange_journal_id(self): + self._set_opening_balance(self.journal_id.id) @api.multi def _balance_check(self): @@ -334,7 +353,7 @@ class AccountBankStatementLine(models.Model): name = fields.Char(string='Memo', required=True) date = fields.Date(required=True, default=lambda self: self._context.get('date', fields.Date.context_today(self))) amount = fields.Monetary(digits=0, currency_field='journal_currency_id') - journal_currency_id = fields.Many2one('res.currency', related='journal_id.currency_id', + journal_currency_id = fields.Many2one('res.currency', related='statement_id.currency_id', help='Utility field to express amount currency', readonly=True) partner_id = fields.Many2one('res.partner', string='Partner') bank_account_id = fields.Many2one('res.partner.bank', string='Bank Account') diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index a37f23628d7..ec452a2c7fb 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -275,8 +275,6 @@ class AccountInvoice(models.Model): company_id = fields.Many2one('res.company', string='Company', change_default=True, required=True, readonly=True, states={'draft': [('readonly', False)]}, default=lambda self: self.env['res.company']._company_default_get('account.invoice')) - check_total = fields.Monetary(string='Verification Total', - readonly=True, states={'draft': [('readonly', False)]}, default=0.0) reconciled = fields.Boolean(string='Paid/Reconciled', store=True, readonly=True, compute='_compute_residual', help="It indicates that the invoice has been paid and the journal entry of the invoice has been reconciled with one or several journal entries of payment.") @@ -674,11 +672,6 @@ class AccountInvoice(models.Model): iml = inv.invoice_line_move_line_get() iml += inv.tax_line_move_line_get() - # I disabled the check_total feature - if self.env['res.users'].has_group('account.group_supplier_inv_check_total'): - if inv.type in ('in_invoice', 'in_refund') and abs(inv.check_total - inv.amount_total) >= (inv.currency_id.rounding / 2.0): - raise UserError(_('Please verify the price of the invoice!\nThe encoded total does not match the computed total.')) - diff_currency = inv.currency_id != company_currency # create one move line for the total and possibly adjust the other lines amount total, total_currency, iml = inv.with_context(ctx).compute_invoice_totals(company_currency, iml) @@ -996,25 +989,6 @@ class AccountInvoiceLine(models.Model): self.price_subtotal_signed = price_subtotal_signed * sign @api.model - def _default_price_unit(self): - if not self._context.get('check_total'): - return 0 - currency = self.invoice_id and self.invoice_id.currency_id or None - total = self._context['check_total'] - for l in self._context.get('invoice_line_ids', []): - if isinstance(l, (list, tuple)) and len(l) >= 3 and l[2]: - vals = l[2] - price = vals.get('price_unit', 0) * (1 - vals.get('discount', 0) / 100.0) - total = total - (price * vals.get('quantity')) - taxes = vals.get('invoice_line_tax_ids') - if taxes and len(taxes[0]) >= 3 and taxes[0][2]: - taxes = self.env['account.tax'].browse(taxes[0][2]) - tax_res = taxes.compute_all(price, currency, vals.get('quantity'), vals.get('product_id'), self._context.get('partner_id')) - for tax in tax_res['taxes']: - total = total - tax['amount'] - return total - - @api.model def _default_account(self): if self._context.get('journal_id'): journal = self.env['account.journal'].browse(self._context.get('journal_id')) @@ -1037,8 +1011,7 @@ class AccountInvoiceLine(models.Model): required=True, domain=[('deprecated', '=', False)], default=_default_account, help="The income or expense account related to the selected product.") - price_unit = fields.Monetary(string='Unit Price', required=True, - default=_default_price_unit) + price_unit = fields.Monetary(string='Unit Price', required=True) price_subtotal = fields.Monetary(string='Amount', store=True, readonly=True, compute='_compute_price') price_subtotal_signed = fields.Monetary(string='Amount Signed', currency_field='company_currency_id', diff --git a/addons/account/models/company.py b/addons/account/models/company.py index 99d6a7da4d4..1d10af65b34 100644 --- a/addons/account/models/company.py +++ b/addons/account/models/company.py @@ -10,10 +10,10 @@ class ResCompany(models.Model): #TODO check all the options/fields are in the views (settings + company form view) fiscalyear_last_day = fields.Integer(default=31, required=True) fiscalyear_last_month = fields.Selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], default=12, required=True) - period_lock_date = fields.Date(help="Only users with the 'Adviser' role can edit accounts prior to and inclusive of this date") - fiscalyear_lock_date = fields.Date(string="Fiscal Year lock date", help="No users, including Advisers, can edit accounts prior to and inclusive of this date") + period_lock_date = fields.Date(string="Lock Date for Non-Advisers", help="Only users with the 'Adviser' role can edit accounts prior to and inclusive of this date. Use it for period locking inside an open fiscal year, for example.") + fiscalyear_lock_date = fields.Date(string="Lock Date", help="No users, including Advisers, can edit accounts prior to and inclusive of this date. Use it for fiscal year locking for example.") transfer_account_id = fields.Many2one('account.account', - domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id), ('deprecated', '=', False)], string="Transfer Account", help="Intermediary account used when moving money from a liquidity account to another") + domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id), ('deprecated', '=', False)], string="Inter-Banks Transfer Account", help="Intermediary account used when moving money from a liquidity account to another") expects_chart_of_accounts = fields.Boolean(string='Expects a Chart of Accounts', default=True) chart_template_id = fields.Many2one('account.chart.template', help='The chart template for the company (if any)') bank_account_code_prefix = fields.Char(string='Prefix of the bank accounts', oldname="bank_account_code_char") @@ -25,7 +25,7 @@ class ResCompany(models.Model): ], default='round_per_line', string='Tax Calculation Rounding Method', help="If you select 'Round per Line' : for each tax, the tax amount will first be computed and rounded for each PO/SO/invoice line and then these rounded amounts will be summed, leading to the total amount for that tax. If you select 'Round Globally': for each tax, the tax amount will be computed for each PO/SO/invoice line, then these amounts will be summed and eventually this total tax amount will be rounded. If you sell with tax included, you should choose 'Round per line' because you certainly want the sum of your tax-included line subtotals to be equal to the total amount with taxes.") paypal_account = fields.Char(string='Paypal Account', size=128, help="Paypal username (usually email) for receiving online payments.") - currency_exchange_journal_id = fields.Many2one('account.journal', string="Currency Adjustments Journal", domain=[('type', '=', 'general')]) + currency_exchange_journal_id = fields.Many2one('account.journal', string="Exchange Gain or Loss Journal", domain=[('type', '=', 'general')]) income_currency_exchange_account_id = fields.Many2one('account.account', related='currency_exchange_journal_id.default_credit_account_id', string="Gain Exchange Rate Account", domain="[('internal_type', '=', 'other'), ('deprecated', '=', False), ('company_id', '=', id)]") expense_currency_exchange_account_id = fields.Many2one('account.account', related='currency_exchange_journal_id.default_debit_account_id', diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py index be8fdfa3cf3..4de26a02943 100644 --- a/addons/account/models/res_config.py +++ b/addons/account/models/res_config.py @@ -66,8 +66,8 @@ class AccountConfigSettings(models.TransientModel): fiscalyear_last_day = fields.Integer(related='company_id.fiscalyear_last_day', default=31) fiscalyear_last_month = fields.Selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], related='company_id.fiscalyear_last_month', default=12) - period_lock_date = fields.Date(related='company_id.period_lock_date', help="Only users with the 'Adviser' role can edit accounts prior to and inclusive of this date") - fiscalyear_lock_date = fields.Date(string="Fiscal Year lock date", related='company_id.fiscalyear_lock_date', help="No users, including Advisers, can edit accounts prior to and inclusive of this date") + period_lock_date = fields.Date(string="Lock Date for Non-Advisers", related='company_id.period_lock_date', help="Only users with the 'Adviser' role can edit accounts prior to and inclusive of this date. Use it for period locking inside an open fiscal year, for example.") + fiscalyear_lock_date = fields.Date(string="Lock Date", related='company_id.fiscalyear_lock_date', help="No users, including Advisers, can edit accounts prior to and inclusive of this date. Use it for fiscal year locking for example.") module_account_check_writing = fields.Boolean(string='Pay your vendors by check', help='This allows you to check writing and printing.\n' @@ -87,9 +87,6 @@ class AccountConfigSettings(models.TransientModel): 'Once the master budgets and the budgets are defined, ' 'the project managers can set the planned amount on each analytic account.\n' '-This installs the module account_budget.') - module_product_email_template = fields.Boolean(string='Send products tools and information at the invoice confirmation', - help='With this module, link your products to a template to send complete information and tools to your customer.\n' - 'For instance when invoicing a training, the training agenda and materials will automatically be send to your customers.') module_account_bank_statement_import_ofx = fields.Boolean(string='Import of Bank Statements in .OFX Format', help='Get your bank statements from you bank and import them in Odoo in .OFX format.\n' '-that installs the module account_bank_statement_import.') @@ -99,16 +96,14 @@ class AccountConfigSettings(models.TransientModel): group_proforma_invoices = fields.Boolean(string='Allow pro-forma invoices', implied_group='account.group_proforma_invoices', help="Allows you to put invoices in pro-forma state.") - default_sale_tax_id = fields.Many2one('account.tax', help="This sale tax will be assigned by default on new products.", oldname="default_sale_tax") - default_purchase_tax_id = fields.Many2one('account.tax', help="This purchase tax will be assigned by default on new products.", oldname="default_purchase_tax") + default_sale_tax_id = fields.Many2one('account.tax', string="Default Sale Tax", help="This sale tax will be assigned by default on new products.", oldname="default_sale_tax") + default_purchase_tax_id = fields.Many2one('account.tax', string="Default Purchase Tax", help="This purchase tax will be assigned by default on new products.", oldname="default_purchase_tax") group_multi_currency = fields.Boolean(string='Allow multi currencies', implied_group='base.group_multi_currency', help="Allows you multi currency environment") group_analytic_accounting = fields.Boolean(string='Analytic accounting', implied_group='analytic.group_analytic_accounting', help="Allows you to use the analytic accounting.") - group_check_supplier_invoice_total = fields.Boolean(string='Check the total of vendor bills', - implied_group="account.group_supplier_inv_check_total") currency_exchange_journal_id = fields.Many2one('account.journal', related='company_id.currency_exchange_journal_id', string="Rate Difference Journal",) diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index f58c77bb71d..5547e561cac 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -26,10 +26,6 @@ <field name="category_id" ref="base.module_category_hidden"/> </record> - <record id="group_supplier_inv_check_total" model="res.groups"> - <field name="name">Check Total on supplier bills</field> - <field name="category_id" ref="base.module_category_hidden"/> - </record> </data> <data noupdate="1"> diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index 7a7a0ad9a4f..a8d0e24675a 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -247,7 +247,6 @@ <field name="move_name" invisible="1"/> <field name="currency_id" options="{'no_create': True}" groups="base.group_multi_currency"/> <field name="company_currency_id" invisible="1"/> - <field name="check_total" groups="account.group_supplier_inv_check_total"/> </group> </group> <notebook> @@ -317,7 +316,7 @@ <field domain="[('company_id', '=', company_id), ('internal_type', '=', 'payable')]" name="account_id" groups="account.group_account_manager"/> <field name="name" invisible="1"/> - <field name="payment_term_id" options="{'no_create': True}"/> + <field name="payment_term_id" options="{'no_create': True}" attrs="{'invisible': [('payment_term_id','=',False)]}"/> </group> <group> <field name="fiscal_position_id" options="{'no_create': True}" placeholder="Auto-detect"/> @@ -351,7 +350,7 @@ <button name="invoice_open" states="draft" string="Validate" class="oe_highlight" groups="base.group_user"/> <button name="invoice_open" states="proforma2" string="Validate" groups="base.group_user"/> <button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/> - <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='open,proforma2,paid' groups="base.group_user" attrs="{'invisible': [('type', '=', 'out_refund')]}"/> + <button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' groups="base.group_user" attrs="{'invisible': ['|',('type', '=', 'out_refund'), ('state', 'not in', ('open','proforma2','paid'))]}"/> <button name="invoice_cancel" states="draft,proforma2,open" string="Cancel Invoice" groups="base.group_no_one"/> <button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" groups="base.group_user"/> <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/> @@ -456,7 +455,7 @@ options="{'no_create': True}" attrs="{'readonly':[('move_name','!=',False)]}"/> <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> <field domain="[('partner_id.ref_company_ids', 'in', [company_id])]" name="partner_bank_id" invisible="1"/> - <field name="date_due"/> + <field name="date_due" groups="base.group_no_one"/> </group> <group> <field domain="[('company_id', '=', company_id),('internal_type','=', 'receivable')]" diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 4404803bfd4..749ccd4287f 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -54,15 +54,15 @@ <span>View</span> </div> <div> - <a type="object" name="open_action_with_context" context="{'action_name': 'action_bank_statement_line', 'search_default_journal': True}">Operations</a> - </div> - <div> <a type="object" name="open_action"> <t t-if="journal_type == 'bank'">Bank Statements</t> <t t-if="journal_type == 'cash'">Cash Statements</t> </a> </div> <div> + <a type="object" name="open_action_with_context" context="{'action_name': 'action_bank_statement_line', 'search_default_journal': True}">Search Operations</a> + </div> + <div> <a type="object" name="open_action" context="{'action_name': 'action_account_moves_all_a'}" groups="base.group_no_one">Journal Items</a> </div> </div> @@ -191,7 +191,7 @@ <div groups="account.group_account_manager" class="row o_kanban_card_settings"> <div class="col-xs-6"> - <a type="object" name="toggle_favorite"><i t-att-class="(record.show_on_dashboard.raw_value ? 'oe_star_on' : 'oe_star_off') + ' fa fa-star o_dashboard_star'" title="Click to add/remove from favorite"></i></a> + <a type="object" name="toggle_favorite"><i t-att-class="(record.show_on_dashboard.raw_value ? 'oe_star_on' : 'oe_star_off') + ' fa fa-star o_dashboard_star'" title="Click to add/remove from favorite"/> Favorite</a> </div> <div class="col-xs-6 text-right"> <a t-if="widget.editable" type="edit">Settings</a> diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 1ddeb8247b6..4df09198f7f 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -431,12 +431,8 @@ <form string="Bank Statement"> <header> <field name="all_lines_reconciled" invisible="1" /> - <span attrs="{'invisible':['|',('all_lines_reconciled','=',True),('line_ids','=',[])]}"> - <button name="%(action_bank_reconcile_bank_statements)d" states="open" string="Reconcile" type="action" class="oe_highlight"/> - </span> - <span attrs="{'invisible':[('all_lines_reconciled','=',False)]}"> - <button name="check_confirm_bank" states="open" string="Validate" type="object" class="oe_highlight"/> - </span> + <button name="%(action_bank_reconcile_bank_statements)d" string="Reconcile" type="action" class="oe_highlight" attrs="{'invisible':['|','|',('all_lines_reconciled','=',True),('line_ids','=',[]),('state', '!=', 'open')]}"/> + <button name="check_confirm_bank" string="Validate" type="object" class="oe_highlight" attrs="{'invisible':['|',('all_lines_reconciled','=',False),('state', '!=', 'open')]}"/> <button name="button_cancel" states="confirm" string="Cancel Statement" type="object"/> <field name="state" widget="statusbar" statusbar_visible="open,confirm"/> </header> @@ -487,11 +483,11 @@ <field name="sequence" readonly="1" invisible="1"/> <field name="journal_entry_ids" invisible="1"/> <field name="date" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> - <field name="name" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> <field name="ref" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> <field name="partner_id" domain="['|',('parent_id','=',False),('is_company','=',True)]" context="{'default_supplier': 1}" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> + <field name="name" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> <field name="amount" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> <field name="journal_currency_id" invisible="1"/> <field name="amount_currency" groups="base.group_multi_currency" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> @@ -586,7 +582,7 @@ <field name="model">account.bank.statement.line</field> <field name="priority">8</field> <field name="arch" type="xml"> - <tree string="Statement lines"> + <tree string="Statement lines" create="False"> <field name="sequence" readonly="1" invisible="1"/> <field name="statement_id" /> <field name="journal_id" invisible="1" /> @@ -655,7 +651,7 @@ <group> <field name="account_id" domain="[('company_id', '=', company_id)]"/> <field name="amount_type"/> - <field name="tax_id" domain="[('company_id', '=', company_id)]"/> + <field name="tax_id" domain="[('company_id', '=', company_id)]" widget="selection" /> <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', company_id)]"/> </group> <group> @@ -665,7 +661,7 @@ <field name="amount" class="oe_inline"/> <label string="%" class="oe_inline" attrs="{'invisible':[('amount_type','!=','percentage')]}" /> </div> - <field name="journal_id" domain="[('company_id', '=', company_id)]"/> + <field name="journal_id" domain="[('company_id', '=', company_id)]" widget="selection"/> </group> </group> <div class="oe_edit_only"> @@ -676,7 +672,7 @@ <group> <field name="second_account_id" domain="[('company_id', '=', company_id)]"/> <field name="second_amount_type"/> - <field name="second_tax_id" domain="[('company_id', '=', company_id)]"/> + <field name="second_tax_id" domain="[('company_id', '=', company_id)]" widget="selection"/> <field name="second_analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', company_id)]"/> </group> <group> @@ -686,7 +682,7 @@ <field name="second_amount" class="oe_inline"/> <label string="%" class="oe_inline" attrs="{'invisible':[('amount_type','!=','percentage')]}" /> </div> - <field name="second_journal_id" domain="[('company_id', '=', company_id)]"/> + <field name="second_journal_id" domain="[('company_id', '=', company_id)]" widget="selection"/> </group> </group> </sheet> diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml index a12a09e458a..517b79d00d2 100644 --- a/addons/account/views/res_config_view.xml +++ b/addons/account/views/res_config_view.xml @@ -125,10 +125,6 @@ </group> </div> <div> - <field name="module_account_accountant" class="oe_inline"/> - <label for="module_account_accountant"/> - </div> - <div> <field name="group_analytic_accounting" class="oe_inline"/> <label for="group_analytic_accounting"/> </div> @@ -156,10 +152,6 @@ <field name="group_proforma_invoices" class="oe_inline"/> <label for="group_proforma_invoices"/> </div> - <div> - <field name="module_product_email_template" class="oe_inline"/> - <label for="module_product_email_template"/> - </div> </div> </group> <group> @@ -175,10 +167,6 @@ <field name="module_account_check_writing" class="oe_inline"/> <label for="module_account_check_writing"/> </div> - <div> - <field name="group_check_supplier_invoice_total" class="oe_inline"/> - <label for="group_check_supplier_invoice_total"/> - </div> </div> </group> <separator string="Bank & Cash"/> diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index 29a4fdf1b41..9456c381817 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -23,9 +23,20 @@ class AccountInvoiceRefund(models.TransientModel): date_invoice = fields.Date(string='Refund Date', default=fields.Date.context_today, required=True) date = fields.Date(string='Accounting Date') description = fields.Char(string='Reason', required=True, default=_get_reason) + refund_only = fields.Boolean(string='Technical field to hide filter_refund in case invoice is partially paid', compute='_get_refund_only') filter_refund = fields.Selection([('refund', 'Create a draft refund'), ('cancel', 'Cancel: create refund and reconcile'), ('modify', 'Modify: create refund, reconcile and create a new draft invoice')], default='refund', string='Refund Method', required=True, help='Refund base on this type. You can not Modify and Cancel if the invoice is already reconciled') + @api.depends('date_invoice') + @api.one + def _get_refund_only(self): + invoice_id = self.env['account.invoice'].browse(self._context.get('active_id',False)) + if len(invoice_id.payment_move_line_ids) != 0 and invoice_id.state != 'paid': + self.refund_only = True + else: + self.refund_only = False + + @api.multi def compute_refund(self, mode='refund'): inv_obj = self.env['account.invoice'] diff --git a/addons/account/wizard/account_invoice_refund_view.xml b/addons/account/wizard/account_invoice_refund_view.xml index f97d1dcd8c9..ef245fbf168 100644 --- a/addons/account/wizard/account_invoice_refund_view.xml +++ b/addons/account/wizard/account_invoice_refund_view.xml @@ -9,21 +9,22 @@ <form string="Credit Note"> <group> <group> - <field name="filter_refund"/> + <field name="refund_only" invisible="1"/> + <field name="filter_refund" attrs="{'invisible': [('refund_only','=',True)]}"/> </group> <group> - <div attrs="{'invisible':[('filter_refund','<>','refund')]}" class="oe_grey" colspan="4"> + <div attrs="{'invisible':['|',('refund_only','=',True),('filter_refund','<>','refund')]}" class="oe_grey" colspan="4"> You will be able to edit and validate this credit note directly or keep it draft, waiting for the document to be issued by your supplier/customer. </div> - <div attrs="{'invisible':[('filter_refund','<>','cancel')]}" class="oe_grey" colspan="4"> + <div attrs="{'invisible':['|',('refund_only','=',True),('filter_refund','<>','cancel')]}" class="oe_grey" colspan="4"> Use this option if you want to cancel an invoice you should not have issued. The credit note will be created, validated and reconciled with the invoice. You will not be able to modify the credit note. </div> - <div attrs="{'invisible':[('filter_refund','<>','modify')]}" class="oe_grey" colspan="4"> + <div attrs="{'invisible':['|',('refund_only','=',True),('filter_refund','<>','modify')]}" class="oe_grey" colspan="4"> Use this option if you want to cancel an invoice and create a new one. The credit note will be created, validated and reconciled with the current invoice. A new, draft, invoice will be created diff --git a/addons/account/wizard/account_validate_move_view.xml b/addons/account/wizard/account_validate_move_view.xml index 16c8bd75263..c805b0edad0 100644 --- a/addons/account/wizard/account_validate_move_view.xml +++ b/addons/account/wizard/account_validate_move_view.xml @@ -8,10 +8,9 @@ <field name="model">validate.account.move</field> <field name="arch" type="xml"> <form string="Post Journal Entries"> - <separator string="Post Journal Entries"/> - <label string="All selected journal entries will be validated and posted. It means you won't be able to modify their accounting fields anymore."/> + <label string="All selected journal entries will be validated and posted. It means you won't be able to modify them afterwards."/> <footer> - <button string="Approve" name="validate_move" type="object" default_focus="1" class="oe_highlight"/> + <button string="Post Journal Entries" name="validate_move" type="object" default_focus="1" class="oe_highlight"/> or <button string="Cancel" class="oe_link" special="cancel"/> </footer> diff --git a/addons/account_asset/views/account_asset_view.xml b/addons/account_asset/views/account_asset_view.xml index d351d3e5865..a5b906577b6 100644 --- a/addons/account_asset/views/account_asset_view.xml +++ b/addons/account_asset/views/account_asset_view.xml @@ -10,13 +10,13 @@ <field name="arch" type="xml"> <form string="Asset category"> <group> + <div class="oe_title oe_inline"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name" class="oe_inline"/> + </h1> + </div> <group> - <div class="oe_title"> - <label for="name" class="oe_edit_only"/> - <h1> - <field name="name" class="oe_inline"/> - </h1> - </div> <field name="type" attrs="{'invisible': 1}"/> <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> </group> diff --git a/addons/account_budget/account_budget.py b/addons/account_budget/account_budget.py index 5c1522c29a1..62f53d6f0b5 100644 --- a/addons/account_budget/account_budget.py +++ b/addons/account_budget/account_budget.py @@ -27,7 +27,6 @@ class account_budget_post(osv.osv): _name = "account.budget.post" _description = "Budgetary Position" _columns = { - 'code': fields.char('Code', size=64, required=True), 'name': fields.char('Name', required=True), 'account_ids': fields.many2many('account.account', 'account_budget_rel', 'budget_id', 'account_id', 'Accounts', domain=[('deprecated', '=', False)]), 'crossovered_budget_line': fields.one2many('crossovered.budget.lines', 'general_budget_id', 'Budget Lines'), diff --git a/addons/account_budget/account_budget_demo.yml b/addons/account_budget/account_budget_demo.yml index 1aab9443b45..afe84b300ea 100644 --- a/addons/account_budget/account_budget_demo.yml +++ b/addons/account_budget/account_budget_demo.yml @@ -6,7 +6,6 @@ if account_ids: vals = { 'name': 'Sales', - 'code': 'SAL', 'account_ids': [(6, None, account_ids)], } self._update(cr, uid, 'account.budget.post', 'account_budget', vals, 'account_budget_post_sales0') @@ -98,7 +97,6 @@ if account_ids: vals = { 'name': 'Purchases', - 'code': 'PUR', 'account_ids': [(6, None, account_ids)], } self._update(cr, uid, 'account.budget.post', 'account_budget', vals, 'account_budget_post_purchase0') diff --git a/addons/account_budget/account_budget_view.xml b/addons/account_budget/account_budget_view.xml index 65a34db6772..0b335758fef 100644 --- a/addons/account_budget/account_budget_view.xml +++ b/addons/account_budget/account_budget_view.xml @@ -9,7 +9,7 @@ <field name="model">account.budget.post</field> <field name="arch" type="xml"> <search string="Budgetary Position"> - <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Budgetary Position"/> + <field name="name" filter_domain="[('name','ilike',self)]" string="Budgetary Position"/> <field name="company_id" groups="base.group_multi_company"/> </search> </field> @@ -20,7 +20,6 @@ <field name="model">account.budget.post</field> <field name="arch" type="xml"> <tree string="Budgetary Position"> - <field name="code"/> <field name="name"/> <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> </tree> @@ -44,12 +43,16 @@ <form string="Budgetary Position"> <group col="4"> <field name="name"/> - <field name="code"/> <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> </group> <notebook> <page string="Accounts"> - <field name="account_ids"/> + <field name="account_ids"> + <tree> + <field name="code"/> + <field name="name"/> + </tree> + </field> </page> </notebook> </form> diff --git a/addons/account_budget/tests/test_theoreticalamount.py b/addons/account_budget/tests/test_theoreticalamount.py index ae96ee17c94..1c82a076fe7 100644 --- a/addons/account_budget/tests/test_theoreticalamount.py +++ b/addons/account_budget/tests/test_theoreticalamount.py @@ -24,7 +24,6 @@ class TestTheoreticalAmount(TransactionCase): account_rev_id = self.registry('account.account').create(cr, uid, {'code': 'X2020', 'name': 'Budget - Test Revenue Account', 'user_type_id': user_type_id, 'tag_ids': [(4, tag_id, 0)]}) buget_post = self.registry('account.budget.post').create(cr, uid, { 'name': 'Sales', - 'code': 'SAL', 'account_ids': [(4, account_rev_id, 0)], }) crossovered_budget_line_id = crossovered_budget_line_obj.create(cr, uid, { diff --git a/addons/account_tax_python/account_tax_python.xml b/addons/account_tax_python/account_tax_python.xml index eaeabedfb11..94cb367fad4 100644 --- a/addons/account_tax_python/account_tax_python.xml +++ b/addons/account_tax_python/account_tax_python.xml @@ -7,7 +7,7 @@ <field name="inherit_id" ref="account.view_tax_form" /> <field name="arch" type="xml"> <xpath expr="//field[@name='children_tax_ids']" position="before"> - <group string="Tax Computation By Python Code" attrs="{'invisible': [('amount_type','!=','code')]}"> + <group attrs="{'invisible': [('amount_type','!=','code')]}"> <group> <field name="python_compute" attrs="{'required':[('amount_type','=','code')]}" /> </group> diff --git a/addons/payment/views/res_config_view.xml b/addons/payment/views/res_config_view.xml index e4e6fc96652..6bd8bff9113 100644 --- a/addons/payment/views/res_config_view.xml +++ b/addons/payment/views/res_config_view.xml @@ -8,6 +8,10 @@ <field name="inherit_id" ref="account.view_account_config_settings"/> <field name="arch" type="xml"> <xpath expr="//div[@name='payment_acquirer']" position="inside"> + <div name="configure_payments_button" invisible="1"> + <button name='%(payment.action_payment_acquirer)d' type="action" + string="Configure payment acquiring methods" class="oe_link"/> + </div> <div> <field name="module_payment_paypal" class="oe_inline"/> <label for="module_payment_paypal"/> diff --git a/addons/payment_paypal/views/res_config_view.xml b/addons/payment_paypal/views/res_config_view.xml index 39d2a8f5dec..5464eff03e5 100644 --- a/addons/payment_paypal/views/res_config_view.xml +++ b/addons/payment_paypal/views/res_config_view.xml @@ -5,11 +5,10 @@ <!-- Add payment options to sale.order and invoice forms --> <record model="ir.ui.view" id="payment_paypal_option_config"> <field name="model">account.config.settings</field> - <field name="inherit_id" ref="account.view_account_config_settings"/> + <field name="inherit_id" ref="payment.payment_acquirer_installation"/> <field name="arch" type="xml"> - <xpath expr="//div[@name='payment_acquirer']" position="inside"> - <button name='%(payment.action_payment_acquirer)d' type="action" - string="Configure payment acquiring methods" class="oe_link"/> + <xpath expr="//div[@name='configure_payments_button']" position="attributes"> + <attribute name="invisible">0</attribute> </xpath> </field> </record> diff --git a/addons/portal_sale/res_config_view.xml b/addons/portal_sale/res_config_view.xml index f6fda66d187..4341264b958 100644 --- a/addons/portal_sale/res_config_view.xml +++ b/addons/portal_sale/res_config_view.xml @@ -11,12 +11,19 @@ <div> <field name="group_payment_options" class="oe_inline"/> <label for="group_payment_options"/> - <button name='%(payment.action_payment_acquirer)d' type="action" - string="Configure payment acquiring methods" class="oe_link"/> </div> </xpath> </field> </record> + <record model="ir.ui.view" id="payment_acquirer_option_config"> + <field name="model">account.config.settings</field> + <field name="inherit_id" ref="payment.payment_acquirer_installation"/> + <field name="arch" type="xml"> + <xpath expr="//div[@name='configure_payments_button']" position="attributes"> + <attribute name="invisible">0</attribute> + </xpath> + </field> + </record> </data> -</openerp>
\ No newline at end of file +</openerp> diff --git a/addons/pos_mercury/views/pos_mercury_views.xml b/addons/pos_mercury/views/pos_mercury_views.xml index 76271909f29..dc8d00f8e28 100644 --- a/addons/pos_mercury/views/pos_mercury_views.xml +++ b/addons/pos_mercury/views/pos_mercury_views.xml @@ -76,19 +76,6 @@ </field> </record> - <record id="view_bank_statements_pos_tree" model="ir.ui.view"> - <field name="name">POS bank statements</field> - <field name="model">account.bank.statement</field> - <field name="inherit_id" ref="account.view_bank_statement_form"/> - <field name="arch" type="xml"> - <xpath expr="//field[@name='amount']" position="before"> - <field name="mercury_prefixed_card_number"/> - <field name="mercury_card_brand"/> - <field name="mercury_card_owner_name"/> - </xpath> - </field> - </record> - <record id="view_pos_order" model="ir.ui.view"> <field name="name">POS orders</field> <field name="model">pos.order</field> diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js index 9e93f126366..4eb44603284 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -109,7 +109,7 @@ $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit') }); -odoo.define('website_sale_options.website_sale', function(require) { +odoo.define('website_sale_options.cart', function(require) { "use strict"; require('website_sale.cart'); |
