Compare commits
43 Commits
14.0-po-li
...
14.0-expli
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c12b496004 | ||
|
|
447b0107be | ||
|
|
f9a7983d71 | ||
|
|
870746b965 | ||
|
|
f22c6522d5 | ||
|
|
1ef97629b7 | ||
|
|
77a372b3ca | ||
|
|
221b090cc8 | ||
|
|
e4a2ff5bd4 | ||
|
|
c1d334b109 | ||
|
|
c7c9b2d341 | ||
|
|
eddab6020a | ||
|
|
d1181ca91d | ||
|
|
bb83765ee2 | ||
|
|
88615a0774 | ||
|
|
05e649fa86 | ||
|
|
08118ec4f5 | ||
|
|
6d496ba302 | ||
|
|
40b79890fe | ||
|
|
58b8d300b8 | ||
|
|
cdcf4eb406 | ||
|
|
a22f79ef44 | ||
|
|
99dd4de4f7 | ||
|
|
f3d6b67043 | ||
|
|
1963af114b | ||
|
|
1da4c40927 | ||
|
|
edc9db5839 | ||
|
|
882d068f1a | ||
|
|
878db1d0a1 | ||
|
|
600acd2f26 | ||
|
|
059c3b4a09 | ||
|
|
895e1d9dd0 | ||
|
|
0b3ffc804f | ||
|
|
c0a03dbb0e | ||
|
|
6e5f263283 | ||
|
|
d4ebbb28d9 | ||
|
|
7dd204e57e | ||
|
|
e1a84973da | ||
|
|
13e68ac0f5 | ||
|
|
3b17c2e5fb | ||
|
|
ce2255623d | ||
|
|
279dc7c6c0 | ||
|
|
45500f5bd8 |
@@ -52,6 +52,7 @@ This modules adds the following functions:
|
|||||||
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
||||||
* Add filter on debit and credit amount for Move Lines
|
* Add filter on debit and credit amount for Move Lines
|
||||||
* Add supplier invoice number in invoice tree view
|
* Add supplier invoice number in invoice tree view
|
||||||
|
* Add date in outstanding payment widget on invoice form view (requires `odoo PR 84180 <https://github.com/odoo/odoo/pull/84180>`_)
|
||||||
|
|
||||||
Together with this module, I recommend the use of the following modules:
|
Together with this module, I recommend the use of the following modules:
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
'data': [
|
'data': [
|
||||||
'views/account_account_type.xml',
|
'views/account_account_type.xml',
|
||||||
'views/account_account.xml',
|
'views/account_account.xml',
|
||||||
|
'views/account_group.xml',
|
||||||
|
'views/account_analytic_account.xml',
|
||||||
|
'views/account_analytic_group.xml',
|
||||||
'views/account_bank_statement.xml',
|
'views/account_bank_statement.xml',
|
||||||
'views/account_invoice_report.xml',
|
'views/account_invoice_report.xml',
|
||||||
'views/account_journal.xml',
|
'views/account_journal.xml',
|
||||||
@@ -28,11 +31,14 @@
|
|||||||
'views/product.xml',
|
'views/product.xml',
|
||||||
'views/res_config_settings.xml',
|
'views/res_config_settings.xml',
|
||||||
'views/res_partner.xml',
|
'views/res_partner.xml',
|
||||||
|
'views/res_company.xml',
|
||||||
'views/account_report.xml',
|
'views/account_report.xml',
|
||||||
'wizard/account_invoice_mark_sent_view.xml',
|
'wizard/account_invoice_mark_sent_view.xml',
|
||||||
'wizard/account_group_generate_view.xml',
|
'wizard/account_group_generate_view.xml',
|
||||||
'wizard/account_payment_register_views.xml',
|
'wizard/account_payment_register_views.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
'report/invoice_report.xml',
|
||||||
],
|
],
|
||||||
|
'qweb': ['static/src/xml/account_payment.xml'],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ from . import account_journal
|
|||||||
from . import account_move
|
from . import account_move
|
||||||
from . import account_partial_reconcile
|
from . import account_partial_reconcile
|
||||||
from . import res_partner
|
from . import res_partner
|
||||||
|
from . import res_company
|
||||||
from . import product
|
from . import product
|
||||||
|
from . import account_invoice_report
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ class AccountBankStatement(models.Model):
|
|||||||
|
|
||||||
def _check_balance_end_real_same_as_computed(self):
|
def _check_balance_end_real_same_as_computed(self):
|
||||||
for stmt in self:
|
for stmt in self:
|
||||||
if stmt.hide_bank_statement_balance:
|
if not stmt.hide_bank_statement_balance:
|
||||||
continue
|
|
||||||
else:
|
|
||||||
super(AccountBankStatement, stmt)._check_balance_end_real_same_as_computed()
|
super(AccountBankStatement, stmt)._check_balance_end_real_same_as_computed()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@@ -80,7 +78,8 @@ class AccountBankStatementLine(models.Model):
|
|||||||
|
|
||||||
def show_account_move(self):
|
def show_account_move(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||||
|
'account.action_move_line_form')
|
||||||
# Note: this action is on account.move, not account.move.line !
|
# Note: this action is on account.move, not account.move.line !
|
||||||
action.update({
|
action.update({
|
||||||
'views': False,
|
'views': False,
|
||||||
|
|||||||
17
account_usability/models/account_invoice_report.py
Normal file
17
account_usability/models/account_invoice_report.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Copyright 2022 Akretion (http://www.akretion.com)
|
||||||
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class AccountInvoiceReport(models.Model):
|
||||||
|
_inherit = 'account.invoice.report'
|
||||||
|
|
||||||
|
industry_id = fields.Many2one('res.partner.industry', string='Partner Industry', readonly=True)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _select(self):
|
||||||
|
res = super()._select()
|
||||||
|
res += ", COALESCE(partner.industry_id, commercial_partner.industry_id) AS industry_id"
|
||||||
|
return res
|
||||||
@@ -16,6 +16,13 @@ class AccountJournal(models.Model):
|
|||||||
"you don't want to enter the start/end balance manually: it "
|
"you don't want to enter the start/end balance manually: it "
|
||||||
"will prevent the display of wrong information in the accounting "
|
"will prevent the display of wrong information in the accounting "
|
||||||
"dashboard and on bank statements.")
|
"dashboard and on bank statements.")
|
||||||
|
# Used to set default user_type_id on account fields
|
||||||
|
account_type_current_liabilities_id = fields.Many2one(
|
||||||
|
'account.account.type',
|
||||||
|
default=lambda self: self.env.ref('account.data_account_type_current_liabilities').id)
|
||||||
|
account_type_current_assets_id = fields.Many2one(
|
||||||
|
'account.account.type',
|
||||||
|
default=lambda self: self.env.ref('account.data_account_type_current_assets').id)
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
|
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models, _
|
||||||
from odoo.tools import float_is_zero
|
from odoo.tools import float_is_zero
|
||||||
from odoo.tools.misc import format_date
|
from odoo.tools.misc import format_date
|
||||||
from odoo.osv import expression
|
from odoo.osv import expression
|
||||||
|
from datetime import timedelta
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class AccountMove(models.Model):
|
class AccountMove(models.Model):
|
||||||
@@ -152,13 +154,13 @@ class AccountMove(models.Model):
|
|||||||
""" French law requires to set sale order dates into invoice
|
""" French law requires to set sale order dates into invoice
|
||||||
returned string: "sale1 (date1), sale2 (date2) ..."
|
returned string: "sale1 (date1), sale2 (date2) ..."
|
||||||
"""
|
"""
|
||||||
for inv in self:
|
for move in self:
|
||||||
sales = inv.invoice_line_ids.mapped(
|
sales = move.invoice_line_ids.mapped(
|
||||||
'sale_line_ids').mapped('order_id')
|
'sale_line_ids').mapped('order_id')
|
||||||
dates = ["%s (%s)" % (
|
dates = ["%s (%s)" % (
|
||||||
x.name, format_date(inv.env, self.date_order))
|
x.name, format_date(move.env, x.date_order))
|
||||||
for x in sales]
|
for x in sales]
|
||||||
inv.sale_dates = ", ".join(dates)
|
move.sale_dates = ", ".join(dates)
|
||||||
|
|
||||||
# allow to manually create moves not only in general journals,
|
# allow to manually create moves not only in general journals,
|
||||||
# but also in cash journal and check journals (= bank journals not linked to a bank account)
|
# but also in cash journal and check journals (= bank journals not linked to a bank account)
|
||||||
@@ -207,6 +209,18 @@ class AccountMove(models.Model):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return '%s.pdf' % (self.name and self.name.replace('/', '_') or 'INV')
|
return '%s.pdf' % (self.name and self.name.replace('/', '_') or 'INV')
|
||||||
|
|
||||||
|
def _get_accounting_date(self, invoice_date, has_tax):
|
||||||
|
# On vendor bills/refunds, we want date = invoice_date unless
|
||||||
|
# we have a company tax_lock_date and the invoice has taxes
|
||||||
|
# and invoice_date <= tax_lock_date
|
||||||
|
date = super()._get_accounting_date(invoice_date, has_tax)
|
||||||
|
if self.is_purchase_document(include_receipts=True):
|
||||||
|
tax_lock_date = self.company_id.tax_lock_date
|
||||||
|
if invoice_date and tax_lock_date and has_tax and invoice_date <= tax_lock_date:
|
||||||
|
invoice_date = tax_lock_date + timedelta(days=1)
|
||||||
|
date = invoice_date
|
||||||
|
return date
|
||||||
|
|
||||||
|
|
||||||
class AccountMoveLine(models.Model):
|
class AccountMoveLine(models.Model):
|
||||||
_inherit = 'account.move.line'
|
_inherit = 'account.move.line'
|
||||||
@@ -231,7 +245,8 @@ class AccountMoveLine(models.Model):
|
|||||||
|
|
||||||
def show_account_move_form(self):
|
def show_account_move_form(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||||
|
'account.action_move_line_form')
|
||||||
action.update({
|
action.update({
|
||||||
'res_id': self.move_id.id,
|
'res_id': self.move_id.id,
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
@@ -251,3 +266,25 @@ class AccountMoveLine(models.Model):
|
|||||||
rec_str = ', '.join([
|
rec_str = ', '.join([
|
||||||
'a%d' % pr.id for pr in line.matched_debit_ids + line.matched_credit_ids])
|
'a%d' % pr.id for pr in line.matched_debit_ids + line.matched_credit_ids])
|
||||||
line.reconcile_string = rec_str
|
line.reconcile_string = rec_str
|
||||||
|
|
||||||
|
def _get_computed_name(self):
|
||||||
|
# This is useful when you want to have the product code in a dedicated
|
||||||
|
# column in your customer invoice report
|
||||||
|
# The same ir.config_parameter is used in sale_usability,
|
||||||
|
# purchase_usability and account_usability
|
||||||
|
no_product_code_param = self.env['ir.config_parameter'].sudo().get_param(
|
||||||
|
'usability.line_name_no_product_code')
|
||||||
|
if no_product_code_param and no_product_code_param == 'True':
|
||||||
|
self = self.with_context(display_default_code=False)
|
||||||
|
return super()._get_computed_name()
|
||||||
|
|
||||||
|
def reconcile(self):
|
||||||
|
"""Explicit error message if unposted lines"""
|
||||||
|
unposted_ids = self.filtered(lambda l: l.move_id.state != "posted")
|
||||||
|
if unposted_ids:
|
||||||
|
m = _("Please post the following entries before reconciliation :")
|
||||||
|
sep = "\n - "
|
||||||
|
unpost = sep.join([am.display_name for am in unposted_ids.move_id])
|
||||||
|
raise UserError(m + sep + unpost)
|
||||||
|
|
||||||
|
return super().reconcile()
|
||||||
|
|||||||
21
account_usability/models/res_company.py
Normal file
21
account_usability/models/res_company.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Copyright 2021 Akretion France (https://akretion.com/)
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ResCompany(models.Model):
|
||||||
|
_inherit = 'res.company'
|
||||||
|
|
||||||
|
# There is a native field invoice_terms which is displayed on res.config.settings
|
||||||
|
# when the ir.config_parameter account.use_invoice_terms is True
|
||||||
|
# But there are several problems with this native field:
|
||||||
|
# - it is copied on the 'narration' field of account.move => we don't want that
|
||||||
|
# - the text block is very small on the form view of res.config.settings
|
||||||
|
# So I decided to have our own field "fixed_invoice_terms"
|
||||||
|
# The native field can still be used when you need to customise some
|
||||||
|
# terms and conditions on each invoice (not very common, but...)
|
||||||
|
# To underline this different with the native field, I prefix it with 'static_'
|
||||||
|
static_invoice_terms = fields.Text(
|
||||||
|
translate=True, string="Legal Terms on Invoice")
|
||||||
19
account_usability/static/src/xml/account_payment.xml
Normal file
19
account_usability/static/src/xml/account_payment.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<templates id="template" xml:space="preserve">
|
||||||
|
|
||||||
|
<!-- Requires https://github.com/odoo/odoo/pull/84180 -->
|
||||||
|
<t t-extend="ShowPaymentInfo" >
|
||||||
|
<t t-jquery="td:first" t-operation="after">
|
||||||
|
<td style="max-width: 25em;" id="outstanding-date">
|
||||||
|
<div class="oe_form_field" style="margin-right: 5px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;"><t t-esc="line.date"></t></div>
|
||||||
|
</td>
|
||||||
|
</t>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
</templates>
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
<field name="name" position="after">
|
<field name="name" position="after">
|
||||||
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
|
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
|
||||||
</field>
|
</field>
|
||||||
|
<filter name="accounttype" position="after">
|
||||||
|
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
|
||||||
|
</filter>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
33
account_usability/views/account_analytic_account.xml
Normal file
33
account_usability/views/account_analytic_account.xml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2015-2021 Akretion France (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_account_analytic_account_list" model="ir.ui.view">
|
||||||
|
<field name="model">account.analytic.account</field>
|
||||||
|
<field name="inherit_id" ref="analytic.view_account_analytic_account_list"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="code" position="after">
|
||||||
|
<field name="group_id" optional="show"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_account_analytic_account_search" model="ir.ui.view">
|
||||||
|
<field name="model">account.analytic.account</field>
|
||||||
|
<field name="inherit_id" ref="analytic.view_account_analytic_account_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter name="associatedpartner" position="before">
|
||||||
|
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
22
account_usability/views/account_analytic_group.xml
Normal file
22
account_usability/views/account_analytic_group.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2021 Akretion France (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="account_analytic_group_tree_view" model="ir.ui.view">
|
||||||
|
<field name="model">account.analytic.group</field>
|
||||||
|
<field name="inherit_id" ref="analytic.account_analytic_group_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="parent_id" optional="show"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
32
account_usability/views/account_group.xml
Normal file
32
account_usability/views/account_group.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2021 Akretion France (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_account_group_form" model="ir.ui.view">
|
||||||
|
<field name="model">account.group</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_group_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="parent_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_group_tree" model="ir.ui.view">
|
||||||
|
<field name="model">account.group</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_group_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="parent_id" optional="show"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -14,16 +14,26 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Invoices Analysis">
|
<tree string="Invoices Analysis">
|
||||||
<field name="move_id"/>
|
<field name="move_id"/>
|
||||||
|
<field name="journal_id" optional="hide"/>
|
||||||
|
<field name="company_id" optional="hide" groups="base.group_multi_company"/>
|
||||||
<field name="invoice_date"/>
|
<field name="invoice_date"/>
|
||||||
<field name="invoice_date_due"/>
|
<field name="invoice_date_due"/>
|
||||||
<field name="move_type"/>
|
<field name="move_type"/>
|
||||||
<field name="commercial_partner_id"/>
|
<field name="commercial_partner_id"/>
|
||||||
|
<field name="partner_id" optional="hide"/>
|
||||||
|
<field name="country_id" optional="hide"/>
|
||||||
|
<field name="industry_id" optional="hide"/>
|
||||||
<field name="invoice_user_id"/>
|
<field name="invoice_user_id"/>
|
||||||
|
<field name="fiscal_position_id" optional="hide"/>
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
|
<field name="product_categ_id" optional="hide"/>
|
||||||
|
<field name="account_id" optional="hide"/>
|
||||||
|
<field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
|
||||||
<field name="quantity" sum="1"/>
|
<field name="quantity" sum="1"/>
|
||||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||||
<field name="price_subtotal" sum="1"/>
|
<field name="price_subtotal" sum="1"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
|
<field name="payment_state" optional="hide"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -14,6 +14,17 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="bank_statements_source" position="after">
|
<field name="bank_statements_source" position="after">
|
||||||
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
||||||
|
<field name="account_type_current_liabilities_id" invisible="1"/>
|
||||||
|
<field name="account_type_current_assets_id" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="suspense_account_id" position="attributes">
|
||||||
|
<attribute name="context">{'default_user_type_id': account_type_current_liabilities_id, 'default_reconcile': True}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="payment_debit_account_id" position="attributes">
|
||||||
|
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="payment_credit_account_id" position="attributes">
|
||||||
|
<attribute name="context">{'default_user_type_id': account_type_current_assets_id, 'default_reconcile': True}</attribute>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -88,10 +88,11 @@
|
|||||||
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
|
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
|
||||||
</field>
|
</field>
|
||||||
<filter name="unreconciled" position="before">
|
<filter name="unreconciled" position="before">
|
||||||
<filter name="reconciled" string="Fully Reconciled" domain="[('full_reconcile_id', '!=', False)]"/>
|
<filter name="reconciled" string="Fully Reconciled" domain="[('reconciled', '=', True)]"/>
|
||||||
</filter>
|
</filter>
|
||||||
<filter name="unreconciled" position="attributes">
|
<filter name="unreconciled" position="attributes">
|
||||||
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
|
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
|
||||||
|
<attribute name="domain">[('reconciled', '=', False), ('balance', '!=', 0), ('account_id.reconcile', '=', True)]</attribute>
|
||||||
</filter>
|
</filter>
|
||||||
<!--
|
<!--
|
||||||
<field name="name" position="attributes">
|
<field name="name" position="attributes">
|
||||||
|
|||||||
27
account_usability/views/res_company.xml
Normal file
27
account_usability/views/res_company.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2021 Akretion (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_company_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.res.company.form</field>
|
||||||
|
<field name="model">res.company</field>
|
||||||
|
<field name="inherit_id" ref="base.view_company_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<notebook position="inside">
|
||||||
|
<page string="Legal Terms" name="legal_terms">
|
||||||
|
<group string="Invoice Legal Terms" name="static_invoice_terms">
|
||||||
|
<field name="static_invoice_terms" nolabel="1"/>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
|
</notebook>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -32,6 +32,7 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'views/product_pricelist_item.xml',
|
'views/product_pricelist_item.xml',
|
||||||
'views/product_template_view.xml',
|
'views/product_template_view.xml',
|
||||||
'views/product_product.xml',
|
'views/product_product.xml',
|
||||||
|
'views/product_category_view.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ from . import product_product
|
|||||||
from . import product_template
|
from . import product_template
|
||||||
from . import product_supplierinfo
|
from . import product_supplierinfo
|
||||||
from . import product_pricelist
|
from . import product_pricelist
|
||||||
|
from . import product_category
|
||||||
|
|||||||
13
product_usability/models/product_category.py
Normal file
13
product_usability/models/product_category.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2022 Akretion (https://www.akretion.com).
|
||||||
|
# @author Sébastien BEAU <sebastien.beau@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ProductCategory(models.Model):
|
||||||
|
_inherit = ['product.category', "mail.thread", "mail.activity.mixin"]
|
||||||
|
_name = 'product.category'
|
||||||
|
|
||||||
|
name = fields.Char(tracking=10)
|
||||||
|
parent_id = fields.Many2one(tracking=20)
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
# Copyright 2015-2021 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# @author Raphaël Valyi <rvalyi@akretion.com>
|
# @author Raphaël Valyi <rvalyi@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields
|
from odoo import api, models, fields
|
||||||
|
|
||||||
|
|
||||||
class ProductProduct(models.Model):
|
class ProductProduct(models.Model):
|
||||||
_inherit = 'product.product'
|
_inherit = 'product.product'
|
||||||
|
|
||||||
default_code = fields.Char(copy=False)
|
default_code = fields.Char(copy=False, tracking=10)
|
||||||
# track_visibility='onchange',
|
barcode = fields.Char(tracking=20)
|
||||||
|
weight = fields.Float(tracking=30)
|
||||||
# barcode = fields.Char(track_visibility='onchange',
|
active = fields.Boolean(tracking=40)
|
||||||
|
barcode_code128 = fields.Char(
|
||||||
# weight = fields.Float(track_visibility='onchange')
|
compute='_compute_barcode_code128',
|
||||||
# active = fields.Boolean(track_visibility='onchange')
|
help="Barcode in Code128-B with start char, checksum and stop char")
|
||||||
|
|
||||||
_sql_constraints = [(
|
_sql_constraints = [(
|
||||||
# Maybe it could be better to have a constrain per company
|
# Maybe it could be better to have a constrain per company
|
||||||
@@ -26,3 +26,32 @@ class ProductProduct(models.Model):
|
|||||||
'default_code_uniq',
|
'default_code_uniq',
|
||||||
'unique(default_code)',
|
'unique(default_code)',
|
||||||
'This internal reference already exists!')]
|
'This internal reference already exists!')]
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _compute_code128_checksum(self, code):
|
||||||
|
# This is NOT a full implementation of code128 checksum
|
||||||
|
csum = 104 # Start B
|
||||||
|
i = 0
|
||||||
|
for char in code:
|
||||||
|
i += 1
|
||||||
|
char_val = ord(char) - 32
|
||||||
|
csum += char_val * i
|
||||||
|
remainder = csum % 103
|
||||||
|
checksum = chr(remainder + 32)
|
||||||
|
return checksum
|
||||||
|
|
||||||
|
@api.depends('barcode')
|
||||||
|
def _compute_barcode_code128(self):
|
||||||
|
# We use Code128-B. Useful info on code128:
|
||||||
|
# https://boowiki.info/art/codes-a-barres/code-128.html
|
||||||
|
# Use code128.ttf and copy it in /usr/local/share/fonts/
|
||||||
|
startb = chr(209)
|
||||||
|
stop = chr(211)
|
||||||
|
for product in self:
|
||||||
|
code128 = False
|
||||||
|
barcode = product.barcode
|
||||||
|
if barcode and all([32 <= ord(x) <= 127 for x in barcode]):
|
||||||
|
checksum = self._compute_code128_checksum(barcode)
|
||||||
|
if checksum:
|
||||||
|
code128 = startb + barcode + checksum + stop
|
||||||
|
product.barcode_code128 = code128
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
# Copyright 2015-2021 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# @author Raphaël Valyi <rvalyi@akretion.com>
|
# @author Raphaël Valyi <rvalyi@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
@@ -21,9 +21,12 @@ class ProductTemplate(models.Model):
|
|||||||
# are only shown in the form view of product.template, not in the form
|
# are only shown in the form view of product.template, not in the form
|
||||||
# view of product.product
|
# view of product.product
|
||||||
name = fields.Char(tracking=10)
|
name = fields.Char(tracking=10)
|
||||||
categ_id = fields.Many2one(tracking=20)
|
barcode = fields.Char(tracking=20)
|
||||||
type = fields.Selection(tracking=30)
|
default_code = fields.Char(tracking=30)
|
||||||
list_price = fields.Float(tracking=40)
|
categ_id = fields.Many2one(tracking=40)
|
||||||
sale_ok = fields.Boolean(tracking=50)
|
type = fields.Selection(tracking=50)
|
||||||
purchase_ok = fields.Boolean(tracking=60)
|
list_price = fields.Float(tracking=60)
|
||||||
active = fields.Boolean(tracking=70)
|
weight = fields.Float(tracking=70)
|
||||||
|
sale_ok = fields.Boolean(tracking=80)
|
||||||
|
purchase_ok = fields.Boolean(tracking=90)
|
||||||
|
active = fields.Boolean(tracking=100)
|
||||||
|
|||||||
19
product_usability/views/product_category_view.xml
Normal file
19
product_usability/views/product_category_view.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="product_category_form_view" model="ir.ui.view">
|
||||||
|
<field name="model">product.category</field>
|
||||||
|
<field name="inherit_id" ref="product.product_category_form_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<sheet position="after">
|
||||||
|
<div class="oe_chatter">
|
||||||
|
<field name="message_follower_ids"/>
|
||||||
|
<field name="activity_ids"/>
|
||||||
|
<field name="message_ids"/>
|
||||||
|
</div>
|
||||||
|
</sheet>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
|
|
||||||
@@ -18,24 +18,17 @@ msgstr ""
|
|||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
||||||
msgid "Analytic Account"
|
msgid "Analytic Account"
|
||||||
msgstr "Compte Analytique"
|
msgstr ""
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_form
|
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_form
|
||||||
msgid "Are you sure you want to cancel this purchase order?"
|
msgid "Are you sure you want to cancel this purchase order?"
|
||||||
msgstr ""
|
msgstr "Êtes-vous sûr de vouloir annuler cette commande?"
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__invoice_status
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
||||||
msgid "Billing Status"
|
msgid "Billing Status"
|
||||||
msgstr "État de facturation"
|
msgstr ""
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
msgid "Bills Received"
|
|
||||||
msgstr "Factures reçues"
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model,name:purchase_usability.model_res_partner
|
#: model:ir.model,name:purchase_usability.model_res_partner
|
||||||
@@ -64,7 +57,7 @@ msgstr ""
|
|||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__display_name
|
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__display_name
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner__display_name
|
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner__display_name
|
||||||
msgid "Display Name"
|
msgid "Display Name"
|
||||||
msgstr "Nom affiché"
|
msgstr "Nom"
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__dest_address_id
|
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__dest_address_id
|
||||||
@@ -76,11 +69,6 @@ msgstr "Adresse de livraison directe"
|
|||||||
msgid "Fiscal Position"
|
msgid "Fiscal Position"
|
||||||
msgstr "Position fiscale"
|
msgstr "Position fiscale"
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__invoiced
|
|
||||||
msgid "Fully Billed"
|
|
||||||
msgstr "Complètement facturé"
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__id
|
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__id
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__id
|
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__id
|
||||||
@@ -102,11 +90,6 @@ msgstr ""
|
|||||||
msgid "Last Modified on"
|
msgid "Last Modified on"
|
||||||
msgstr "Dernière modification le"
|
msgstr "Dernière modification le"
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__no
|
|
||||||
msgid "Nothing to Bill"
|
|
||||||
msgstr "Rien à facturer"
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_method
|
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_method
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_template__purchase_method
|
#: model:ir.model.fields,help:purchase_usability.field_product_template__purchase_method
|
||||||
@@ -130,12 +113,12 @@ msgstr "Imprimer"
|
|||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__product_barcode
|
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__product_barcode
|
||||||
msgid "Product Barcode"
|
msgid "Product Barcode"
|
||||||
msgstr "Code-barre produit"
|
msgstr ""
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model,name:purchase_usability.model_product_template
|
#: model:ir.model,name:purchase_usability.model_product_template
|
||||||
msgid "Product Template"
|
msgid "Product Template"
|
||||||
msgstr "Modèle d'article"
|
msgstr "Modèle de produit"
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model,name:purchase_usability.model_purchase_order
|
#: model:ir.model,name:purchase_usability.model_purchase_order
|
||||||
@@ -147,7 +130,7 @@ msgstr "Commande fournisseur"
|
|||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model,name:purchase_usability.model_purchase_order_line
|
#: model:ir.model,name:purchase_usability.model_purchase_order_line
|
||||||
msgid "Purchase Order Line"
|
msgid "Purchase Order Line"
|
||||||
msgstr "Ligne de commande fournisseur"
|
msgstr "Ligne de commande d'achat"
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_product__purchase_line_warn
|
#: model:ir.model.fields,field_description:purchase_usability.field_product_product__purchase_line_warn
|
||||||
@@ -179,7 +162,7 @@ msgstr ""
|
|||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
||||||
msgid "Reference, Origin or Vendor Reference"
|
msgid "Reference, Origin or Vendor Reference"
|
||||||
msgstr "Référence, Origine ou Référence fournisseur"
|
msgstr ""
|
||||||
|
|
||||||
#. module: purchase_usability
|
#. module: purchase_usability
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_line_warn
|
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_line_warn
|
||||||
@@ -200,9 +183,3 @@ msgstr ""
|
|||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__partner_ref
|
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__partner_ref
|
||||||
msgid "Vendor Reference"
|
msgid "Vendor Reference"
|
||||||
msgstr "Référence fournisseur"
|
msgstr "Référence fournisseur"
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__to_invoice
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
msgid "Waiting Bills"
|
|
||||||
msgstr "Factures en attente"
|
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
# Translation of Odoo Server.
|
|
||||||
# This file contains the translation of the following modules:
|
|
||||||
# * purchase_usability
|
|
||||||
#
|
|
||||||
msgid ""
|
|
||||||
msgstr ""
|
|
||||||
"Project-Id-Version: Odoo Server 14.0\n"
|
|
||||||
"Report-Msgid-Bugs-To: \n"
|
|
||||||
"POT-Creation-Date: 2021-11-02 09:44+0000\n"
|
|
||||||
"PO-Revision-Date: 2021-11-02 09:44+0000\n"
|
|
||||||
"Last-Translator: \n"
|
|
||||||
"Language-Team: \n"
|
|
||||||
"MIME-Version: 1.0\n"
|
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
|
||||||
"Content-Transfer-Encoding: \n"
|
|
||||||
"Plural-Forms: \n"
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
msgid "Analytic Account"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_form
|
|
||||||
msgid "Are you sure you want to cancel this purchase order?"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__invoice_status
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
|
||||||
msgid "Billing Status"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
msgid "Bills Received"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model,name:purchase_usability.model_res_partner
|
|
||||||
msgid "Contact"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_product__purchase_method
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__purchase_method
|
|
||||||
msgid "Control Policy"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__currency_id
|
|
||||||
msgid "Currency"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__delivery_partner_id
|
|
||||||
msgid "Delivery Partner"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__display_name
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__display_name
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__display_name
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner__display_name
|
|
||||||
msgid "Display Name"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__dest_address_id
|
|
||||||
msgid "Drop Ship Address"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__fiscal_position_id
|
|
||||||
msgid "Fiscal Position"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__invoiced
|
|
||||||
msgid "Fully Billed"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__id
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__id
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__id
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner__id
|
|
||||||
msgid "ID"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_purchase_order_line__product_barcode
|
|
||||||
msgid "International Article Number used for product identification."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template____last_update
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order____last_update
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line____last_update
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner____last_update
|
|
||||||
msgid "Last Modified on"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__no
|
|
||||||
msgid "Nothing to Bill"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_method
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_template__purchase_method
|
|
||||||
msgid ""
|
|
||||||
"On ordered quantities: Control bills based on ordered quantities.\n"
|
|
||||||
"On received quantities: Control bills based on received quantities."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__payment_term_id
|
|
||||||
msgid "Payment Terms"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_form
|
|
||||||
msgid "Print"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__product_barcode
|
|
||||||
msgid "Product Barcode"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model,name:purchase_usability.model_product_template
|
|
||||||
msgid "Product Template"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model,name:purchase_usability.model_purchase_order
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_partner__purchase_warn
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_res_users__purchase_warn
|
|
||||||
msgid "Purchase Order"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model,name:purchase_usability.model_purchase_order_line
|
|
||||||
msgid "Purchase Order Line"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_product__purchase_line_warn
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__purchase_line_warn
|
|
||||||
msgid "Purchase Order Line Warning"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_purchase_order__dest_address_id
|
|
||||||
msgid ""
|
|
||||||
"Put an address if you want to deliver directly from the vendor to the "
|
|
||||||
"customer. Otherwise, keep empty to deliver to your own company."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_purchase_order__partner_ref
|
|
||||||
msgid ""
|
|
||||||
"Reference of the sales order or bid sent by the vendor. It's used to do the "
|
|
||||||
"matching when you receive the products as this reference is usually written "
|
|
||||||
"on the delivery order sent by your vendor."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
|
|
||||||
msgid "Reference, Origin or Vendor Reference"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_line_warn
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_product_template__purchase_line_warn
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_res_partner__purchase_warn
|
|
||||||
#: model:ir.model.fields,help:purchase_usability.field_res_users__purchase_warn
|
|
||||||
msgid ""
|
|
||||||
"Selecting the \"Warning\" option will notify user with the message, "
|
|
||||||
"Selecting \"Blocking Message\" will throw an exception with the message and "
|
|
||||||
"block the flow. The Message has to be written in the next field."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__partner_ref
|
|
||||||
msgid "Vendor Reference"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#. module: purchase_usability
|
|
||||||
#: model:ir.model.fields.selection,name:purchase_usability.selection__purchase_order_line__invoice_status__to_invoice
|
|
||||||
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
|
|
||||||
msgid "Waiting Bills"
|
|
||||||
msgstr ""
|
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import api, fields, models
|
||||||
from odoo.tools.misc import formatLang
|
from odoo.tools.misc import formatLang
|
||||||
from odoo.tools import float_is_zero
|
|
||||||
|
|
||||||
|
|
||||||
class PurchaseOrder(models.Model):
|
class PurchaseOrder(models.Model):
|
||||||
@@ -74,33 +73,28 @@ class PurchaseOrderLine(models.Model):
|
|||||||
|
|
||||||
# for optional display in tree view
|
# for optional display in tree view
|
||||||
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||||
invoice_status = fields.Selection(
|
product_supplier_code = fields.Char(
|
||||||
[
|
compute='_compute_product_supplier_code', string='Vendor Product Code')
|
||||||
("no", "Nothing to Bill"),
|
|
||||||
("to invoice", "Waiting Bills"),
|
|
||||||
("invoiced", "Fully Billed"),
|
|
||||||
],
|
|
||||||
string="Billing Status",
|
|
||||||
compute="_compute_invoice_status",
|
|
||||||
store=True,
|
|
||||||
readonly=True,
|
|
||||||
default="no",
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.depends("state", "qty_to_invoice", "qty_invoiced")
|
def _compute_product_supplier_code(self):
|
||||||
def _compute_invoice_status(self):
|
|
||||||
"""Mimic PO '_get_invoiced' method to compute PO line invoice status"""
|
|
||||||
prec = self.env["decimal.precision"].precision_get("Product Unit of Measure")
|
|
||||||
for line in self:
|
for line in self:
|
||||||
if line.state not in ("purchase", "done") or line.display_type:
|
code = False
|
||||||
line.invoice_status = "no"
|
if not line.display_type and line.product_id and line.order_id:
|
||||||
continue
|
partner_id = line.order_id.partner_id.commercial_partner_id.id
|
||||||
|
if partner_id:
|
||||||
|
for supplier_info in line.product_id.seller_ids:
|
||||||
|
if supplier_info.name.id == partner_id:
|
||||||
|
code = supplier_info.product_code
|
||||||
|
break
|
||||||
|
line.product_supplier_code = code
|
||||||
|
|
||||||
if not float_is_zero(line.qty_to_invoice, precision_digits=prec):
|
def _get_product_purchase_description(self, product_lang):
|
||||||
line.invoice_status = "to invoice"
|
# This is useful when you want to have the product code in a dedicated
|
||||||
elif float_is_zero(
|
# column in your purchase order report
|
||||||
line.qty_to_invoice, precision_digits=prec
|
# The same ir.config_parameter is used in sale_usability,
|
||||||
) and not float_is_zero(line.qty_invoiced, precision_digits=prec):
|
# purchase_usability and account_usability
|
||||||
line.invoice_status = "invoiced"
|
no_product_code_param = self.env['ir.config_parameter'].sudo().get_param(
|
||||||
else:
|
'usability.line_name_no_product_code')
|
||||||
line.invoice_status = "no"
|
if no_product_code_param and no_product_code_param == 'True':
|
||||||
|
product_lang = product_lang.with_context(display_default_code=False)
|
||||||
|
return super()._get_product_purchase_description(product_lang)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
<attribute name="groups">analytic.group_analytic_tags</attribute>
|
<attribute name="groups">analytic.group_analytic_tags</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after">
|
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after">
|
||||||
|
<field name="product_supplier_code" optional="hide"/>
|
||||||
<field name="product_barcode" optional="hide"/>
|
<field name="product_barcode" optional="hide"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
@@ -131,10 +132,7 @@
|
|||||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||||
</field>
|
</field>
|
||||||
<field name="date_planned" position="after">
|
<field name="date_planned" position="after">
|
||||||
<field name="state" decoration-success="state == 'purchase' or state == 'done'" decoration-warning="state == 'to approve'"
|
<field name="state"/>
|
||||||
decoration-info="state == 'draft' or state == 'sent'" optional="show" widget="badge" />
|
|
||||||
<field name="invoice_status" decoration-success="invoice_status == 'invoiced'" decoration-info="invoice_status == 'to invoice'"
|
|
||||||
optional="show" widget="badge" />
|
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -147,13 +145,7 @@
|
|||||||
<field name="partner_id" position="after">
|
<field name="partner_id" position="after">
|
||||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||||
</field>
|
</field>
|
||||||
<xpath expr="//filter[@name='hide_cancelled']" position="after">
|
|
||||||
<separator/>
|
|
||||||
<filter name="not_invoiced" string="Waiting Bills" domain="[('invoice_status', '=', 'to invoice')]" />
|
|
||||||
<filter name="invoiced" string="Bills Received" domain="[('invoice_status', '=', 'invoiced')]" />
|
|
||||||
</xpath>
|
|
||||||
<group expand="0" position="inside">
|
<group expand="0" position="inside">
|
||||||
<filter string="Billing Status" name="invoice_status" context="{'group_by' : 'invoice_status'}" />
|
|
||||||
<filter string="Analytic Account" name="account_analytic_groupby" context="{'group_by': 'account_analytic_id'}" groups="analytic.group_analytic_accounting"/>
|
<filter string="Analytic Account" name="account_analytic_groupby" context="{'group_by': 'account_analytic_id'}" groups="analytic.group_analytic_accounting"/>
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
'depends': [
|
'depends': [
|
||||||
'sale',
|
'sale',
|
||||||
|
'account_usability', # for company view
|
||||||
'base_view_inheritance_extension',
|
'base_view_inheritance_extension',
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
'views/sale_report.xml',
|
'views/sale_report.xml',
|
||||||
'views/product_pricelist_item.xml',
|
'views/product_pricelist_item.xml',
|
||||||
'views/account_move.xml',
|
'views/account_move.xml',
|
||||||
|
'views/res_company.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ from . import sale_order
|
|||||||
from . import account_move
|
from . import account_move
|
||||||
from . import product_template
|
from . import product_template
|
||||||
from . import res_partner
|
from . import res_partner
|
||||||
|
from . import res_company
|
||||||
|
|||||||
13
sale_usability/models/res_company.py
Normal file
13
sale_usability/models/res_company.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2021 Akretion France (https://akretion.com/)
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ResCompany(models.Model):
|
||||||
|
_inherit = 'res.company'
|
||||||
|
|
||||||
|
# Similar to the field static_invoice_terms in account_usability
|
||||||
|
static_sale_terms = fields.Text(
|
||||||
|
translate=True, string="Legal Terms on Quotation")
|
||||||
@@ -124,3 +124,14 @@ class SaleOrderLine(models.Model):
|
|||||||
self.env, new_price, currency_obj=pricelist.currency_id))
|
self.env, new_price, currency_obj=pricelist.currency_id))
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def get_sale_order_line_multiline_description_sale(self, product):
|
||||||
|
# This is useful when you want to have the product code in a dedicated
|
||||||
|
# column in your sale order report
|
||||||
|
# The same ir.config_parameter is used in sale_usability,
|
||||||
|
# purchase_usability and account_usability
|
||||||
|
no_product_code_param = self.env['ir.config_parameter'].sudo().get_param(
|
||||||
|
'usability.line_name_no_product_code')
|
||||||
|
if no_product_code_param and no_product_code_param == 'True':
|
||||||
|
product = product.with_context(display_default_code=False)
|
||||||
|
return super().get_sale_order_line_multiline_description_sale(product)
|
||||||
|
|||||||
25
sale_usability/views/res_company.xml
Normal file
25
sale_usability/views/res_company.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2021 Akretion (http://www.akretion.com/)
|
||||||
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_company_form" model="ir.ui.view">
|
||||||
|
<field name="name">sale_usability.res.company.form</field>
|
||||||
|
<field name="model">res.company</field>
|
||||||
|
<field name="inherit_id" ref="account_usability.view_company_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<group name="static_invoice_terms" position="after">
|
||||||
|
<group name="static_sale_terms" string="Quotation Legal Terms">
|
||||||
|
<field name="static_sale_terms" nolabel="1"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -54,4 +54,9 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="sale.action_order_report_all" model="ir.actions.act_window">
|
||||||
|
<!-- native order is graph,pivot -->
|
||||||
|
<field name="view_mode">pivot,graph</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
'depends': ['stock'],
|
'depends': ['stock'],
|
||||||
'data': ['view.xml'],
|
'data': ['view.xml'],
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
from . import stock_move
|
from . import stock_move
|
||||||
from . import stock_picking
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
# Copyright (C) 2021 Akretion (<http://www.akretion.com>).
|
|
||||||
# @author Kévin Roche <kevin.roche@akretion.com>
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
|
|
||||||
from odoo import api, fields, models
|
|
||||||
|
|
||||||
|
|
||||||
class StockPicking(models.Model):
|
|
||||||
_inherit = "stock.picking"
|
|
||||||
|
|
||||||
def action_fill_quantity_done(self):
|
|
||||||
self.ensure_one()
|
|
||||||
for move in self.move_ids_without_package:
|
|
||||||
if move.move_line_ids:
|
|
||||||
first_line = move.move_line_ids[0]
|
|
||||||
else:
|
|
||||||
first_line = False
|
|
||||||
if move.quantity_done == 0 and first_line:
|
|
||||||
qty = move.product_uom_qty
|
|
||||||
if first_line.qty_done == 0:
|
|
||||||
first_line.write(
|
|
||||||
{
|
|
||||||
"qty_done": qty,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
elif move.quantity_done < move.product_uom_qty or (
|
|
||||||
move.quantity_done == 0 and not first_line
|
|
||||||
):
|
|
||||||
qty = move.product_uom_qty - move.quantity_done
|
|
||||||
self.env["stock.move.line"].create(
|
|
||||||
{
|
|
||||||
"move_id": move.id,
|
|
||||||
"location_dest_id": move.location_dest_id.id,
|
|
||||||
"location_id": move.location_id.id,
|
|
||||||
"product_uom_id": move.product_uom.id,
|
|
||||||
"qty_done": qty,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@@ -12,16 +12,6 @@
|
|||||||
name="attrs"
|
name="attrs"
|
||||||
>{'column_invisible': [('parent.state', '=', 'done')]}</attribute>
|
>{'column_invisible': [('parent.state', '=', 'done')]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr="//field[@name='move_ids_without_package']" position="before">
|
|
||||||
<button
|
|
||||||
name="action_fill_quantity_done"
|
|
||||||
type="object"
|
|
||||||
string="Fill Done Quantity"
|
|
||||||
class="btn btn-primary"
|
|
||||||
>
|
|
||||||
</button>
|
|
||||||
</xpath>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
0
web_tab_title/__init__.py
Normal file
0
web_tab_title/__init__.py
Normal file
23
web_tab_title/__manifest__.py
Normal file
23
web_tab_title/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Copyright 2021 Akretion
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Web Tab Title',
|
||||||
|
'description': """
|
||||||
|
Automatically set tab document.title when empty.
|
||||||
|
Important limitation: the tab will get its title only once you browse it.
|
||||||
|
""",
|
||||||
|
'version': '14.0.1.0.0',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'akretion.com',
|
||||||
|
'depends': [
|
||||||
|
'web',
|
||||||
|
],
|
||||||
|
'data': [
|
||||||
|
],
|
||||||
|
'demo': [
|
||||||
|
],
|
||||||
|
"data": ["views/web_tab_title.xml"],
|
||||||
|
"maintainers": ["rvalyi"],
|
||||||
|
}
|
||||||
29
web_tab_title/static/src/js/abstract_web_client.js
Normal file
29
web_tab_title/static/src/js/abstract_web_client.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/* global vis, py */
|
||||||
|
odoo.define("web_tab_title.AbstractWebClient", function (require) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var AbstractWebClient = require('web.AbstractWebClient');
|
||||||
|
|
||||||
|
var TabTitleAbstractWebClient = AbstractWebClient.include({
|
||||||
|
|
||||||
|
_title_changed: function () {
|
||||||
|
// like the original except we change the title
|
||||||
|
// only when it's different from "Odoo" to avoid
|
||||||
|
// resetting the tab title when switching tabs.
|
||||||
|
var parts = _.sortBy(_.keys(this.get("title_part")), function (x) { return x; });
|
||||||
|
var tmp = "";
|
||||||
|
_.each(parts, function (part) {
|
||||||
|
var str = this.get("title_part")[part];
|
||||||
|
if (str) {
|
||||||
|
tmp = tmp ? tmp + " - " + str : str;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
if (tmp != "Odoo") {
|
||||||
|
document.title = tmp;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return TabTitleAbstractWebClient;
|
||||||
|
});
|
||||||
31
web_tab_title/static/src/js/form_controller.js
Normal file
31
web_tab_title/static/src/js/form_controller.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/* global vis, py */
|
||||||
|
odoo.define("web_tab_title.FormController", function (require) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var FormController = require('web.FormController');
|
||||||
|
|
||||||
|
var TabTitleController = FormController.include({
|
||||||
|
|
||||||
|
on_attach_callback: function () {
|
||||||
|
this._super.apply(this, arguments);
|
||||||
|
|
||||||
|
if (document.title == "Odoo") {
|
||||||
|
var form_name_elem = $("div.oe_title>h1");
|
||||||
|
if (form_name_elem.length == 0) {
|
||||||
|
form_name_elem = $('span.o_field_char[name="name"]')
|
||||||
|
}
|
||||||
|
var title = form_name_elem.text();
|
||||||
|
if (title !== '') {
|
||||||
|
// alternatively we could access the record
|
||||||
|
// in views/basic/basic_model.js
|
||||||
|
// but we would also we miss the model name
|
||||||
|
document.title = title + " - Odoo";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return TabTitleController;
|
||||||
|
});
|
||||||
19
web_tab_title/views/web_tab_title.xml
Normal file
19
web_tab_title/views/web_tab_title.xml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<template
|
||||||
|
id="assets_backend"
|
||||||
|
name="web_timeline assets"
|
||||||
|
inherit_id="web.assets_backend"
|
||||||
|
>
|
||||||
|
<xpath expr="." position="inside">
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="/web_tab_title/static/src/js/form_controller.js"
|
||||||
|
/>
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="/web_tab_title/static/src/js/abstract_web_client.js"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
|
</template>
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user