[IMP] account: various improvements
- show period along with 'Tax Report' activity of journals on accounting dashboard. - added 'Upload Invoices' button on sales journals in Accounting Dashboard. - added 'New Bill' button on purchase journals in Accounting Dashboard. Task: 34740 Closes: #34740 Co-authored-by: Hardik Prajapati <hpr@odoo.com>
This commit is contained in:
committed by
Ravi Gohil
co-authored by
Hardik Prajapati
parent
36757cde6d
commit
4a1bbbff75
@@ -1054,6 +1054,7 @@ class AccountJournal(models.Model):
|
|||||||
'res_model': 'account.move',
|
'res_model': 'account.move',
|
||||||
'views': [[False, "tree"], [False, "form"]],
|
'views': [[False, "tree"], [False, "form"]],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
|
'context': self._context
|
||||||
}
|
}
|
||||||
if len(invoices) == 1:
|
if len(invoices) == 1:
|
||||||
action_vals.update({'res_id': invoices[0].id, 'view_mode': 'form'})
|
action_vals.update({'res_id': invoices[0].id, 'view_mode': 'form'})
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class account_journal(models.Model):
|
|||||||
act_type.name as act_type_name,
|
act_type.name as act_type_name,
|
||||||
act_type.category as activity_category,
|
act_type.category as activity_category,
|
||||||
act.date_deadline,
|
act.date_deadline,
|
||||||
|
m.date,
|
||||||
CASE WHEN act.date_deadline < CURRENT_DATE THEN 'late' ELSE 'future' END as status
|
CASE WHEN act.date_deadline < CURRENT_DATE THEN 'late' ELSE 'future' END as status
|
||||||
FROM account_move m
|
FROM account_move m
|
||||||
LEFT JOIN mail_activity act ON act.res_id = m.id
|
LEFT JOIN mail_activity act ON act.res_id = m.id
|
||||||
@@ -54,7 +55,7 @@ class account_journal(models.Model):
|
|||||||
'res_id': activity.get('res_id'),
|
'res_id': activity.get('res_id'),
|
||||||
'res_model': activity.get('res_model'),
|
'res_model': activity.get('res_model'),
|
||||||
'status': activity.get('status'),
|
'status': activity.get('status'),
|
||||||
'name': activity.get('summary') or activity.get('act_type_name'),
|
'name': (activity.get('summary') or activity.get('act_type_name')) + '(' + format_date(activity.get('date'), 'MMM', locale=self._context.get('lang') or 'en_US') + ')',
|
||||||
'activity_category': activity.get('activity_category'),
|
'activity_category': activity.get('activity_category'),
|
||||||
'date': odoo_format_date(self.env, activity.get('date_deadline'))
|
'date': odoo_format_date(self.env, activity.get('date_deadline'))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2194,14 +2194,14 @@ class AccountMoveLine(models.Model):
|
|||||||
tax_group_id = fields.Many2one(related='tax_line_id.tax_group_id', string='Originator tax group',
|
tax_group_id = fields.Many2one(related='tax_line_id.tax_group_id', string='Originator tax group',
|
||||||
readonly=True, store=True,
|
readonly=True, store=True,
|
||||||
help='technical field for widget tax-group-custom-field')
|
help='technical field for widget tax-group-custom-field')
|
||||||
tax_base_amount = fields.Monetary(string="Base Amount", store=True,
|
tax_base_amount = fields.Monetary(string="Base Amount", store=True, readonly=True,
|
||||||
currency_field='company_currency_id')
|
currency_field='company_currency_id')
|
||||||
tax_exigible = fields.Boolean(string='Appears in VAT report', default=True,
|
tax_exigible = fields.Boolean(string='Appears in VAT report', default=True, readonly=True,
|
||||||
help="Technical field used to mark a tax line as exigible in the vat report or not (only exigible journal items"
|
help="Technical field used to mark a tax line as exigible in the vat report or not (only exigible journal items"
|
||||||
" are displayed). By default all new journal items are directly exigible, but with the feature cash_basis"
|
" are displayed). By default all new journal items are directly exigible, but with the feature cash_basis"
|
||||||
" on taxes, some will become exigible only when the payment is recorded.")
|
" on taxes, some will become exigible only when the payment is recorded.")
|
||||||
tax_repartition_line_id = fields.Many2one(comodel_name='account.tax.repartition.line',
|
tax_repartition_line_id = fields.Many2one(comodel_name='account.tax.repartition.line',
|
||||||
string="Originator Tax Repartition Line", ondelete='restrict',
|
string="Originator Tax Repartition Line", ondelete='restrict', readonly=True,
|
||||||
help="Tax repartition line that caused the creation of this move line, if any")
|
help="Tax repartition line that caused the creation of this move line, if any")
|
||||||
tag_ids = fields.Many2many(string="Tags", comodel_name='account.account.tag', ondelete='restrict',
|
tag_ids = fields.Many2many(string="Tags", comodel_name='account.account.tag', ondelete='restrict',
|
||||||
help="Tags assigned to this line by the tax creating it, if any. It determines its impact on financial reports.")
|
help="Tags assigned to this line by the tax creating it, if any. It determines its impact on financial reports.")
|
||||||
|
|||||||
@@ -99,6 +99,22 @@ odoo.define('account.dashboard.kanban', function (require) {
|
|||||||
'click .o_button_upload_bill': '_onUpload',
|
'click .o_button_upload_bill': '_onUpload',
|
||||||
'change .o_vendor_bill_upload .o_form_binary_form': '_onAddAttachment',
|
'change .o_vendor_bill_upload .o_form_binary_form': '_onAddAttachment',
|
||||||
}),
|
}),
|
||||||
|
/**
|
||||||
|
* We override _onUpload (from the upload bill mixin) to pass default_journal_id
|
||||||
|
* and default_type in context.
|
||||||
|
*
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
_onUpload: function (event) {
|
||||||
|
var kanbanRecord = $(event.currentTarget).closest('.o_kanban_record').data('record');
|
||||||
|
this.initialState.context['default_journal_id'] = kanbanRecord.id;
|
||||||
|
if ($(event.currentTarget).attr('journal_type') == 'sale') {
|
||||||
|
this.initialState.context['default_type'] = 'out_invoice'
|
||||||
|
} else if ($(event.currentTarget).attr('journal_type') == 'purchase') {
|
||||||
|
this.initialState.context['default_type'] = 'in_invoice'
|
||||||
|
}
|
||||||
|
UploadBillMixin._onUpload.apply(this, arguments);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var DashboardKanbanView = KanbanView.extend({
|
var DashboardKanbanView = KanbanView.extend({
|
||||||
|
|||||||
@@ -294,9 +294,15 @@
|
|||||||
<button type="object" name="action_create_new" class="btn btn-primary o_invoice_new">
|
<button type="object" name="action_create_new" class="btn btn-primary o_invoice_new">
|
||||||
<span>New Invoice</span>
|
<span>New Invoice</span>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-primary d-block o_button_upload_bill" journal_type="sale">
|
||||||
|
<span>Upload Invoices</span>
|
||||||
|
</button>
|
||||||
</t>
|
</t>
|
||||||
<t t-if="journal_type == 'purchase'">
|
<t t-if="journal_type == 'purchase'">
|
||||||
<button class="btn btn-primary o_button_upload_bill" journal_type="purchase">
|
<button type="object" name="action_create_new" class="btn btn-primary o_invoice_new">
|
||||||
|
<span>New Bill</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary d-block o_button_upload_bill" journal_type="purchase">
|
||||||
<span>Upload Bills</span>
|
<span>Upload Bills</span>
|
||||||
</button>
|
</button>
|
||||||
</t>
|
</t>
|
||||||
|
|||||||
@@ -809,9 +809,9 @@
|
|||||||
<field name="date" invisible="1"/>
|
<field name="date" invisible="1"/>
|
||||||
<field name="tax_line_id" invisible="1"/>
|
<field name="tax_line_id" invisible="1"/>
|
||||||
<field name="tax_group_id" invisible="1"/>
|
<field name="tax_group_id" invisible="1"/>
|
||||||
<field name="tax_repartition_line_id" invisible="1"/>
|
<field name="tax_repartition_line_id" invisible="1" force_save="1"/>
|
||||||
<field name="tax_base_amount" invisible="1"/>
|
<field name="tax_base_amount" invisible="1" force_save="1"/>
|
||||||
<field name="tax_exigible" invisible="1"/>
|
<field name="tax_exigible" invisible="1" force_save="1"/>
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1"/>
|
||||||
<field name="company_currency_id" invisible="1"/>
|
<field name="company_currency_id" invisible="1"/>
|
||||||
<field name="recompute_tax_line" invisible="1" force_save="1"/>
|
<field name="recompute_tax_line" invisible="1" force_save="1"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user