Compare commits

..

22 Commits

Author SHA1 Message Date
clementmbr
9333386663 [UPD] french translation on purchase_usability 2021-12-06 12:28:27 +01:00
clementmbr
34793b639f [IMP] purchase_usability: add invoice_status on PO line 2021-12-06 12:28:27 +01:00
Kev-Roche
4520b7d761 [TRAD][14.0] French traduction purchase_usability 2021-12-06 12:28:27 +01:00
Kevin.roche
dbedf6145f [ADD] stock_reception_usability 2021-12-06 12:28:27 +01:00
Alexis de Lattre
e5cad2635d stock_valuation_xlsx: first port to v14 without price history (when you ask for a past price, you get the current price for the moment) 2021-12-06 12:28:27 +01:00
Alexis de Lattre
6322930535 [MIG] link_tracker_usability from v10 to v14
Prepare port of mass_mailing_usability... but no real port for the moment
2021-12-06 12:28:27 +01:00
Alexis de Lattre
747d2fa71d mass_mailing_usability: Fix dependencies 2021-12-06 12:28:27 +01:00
Alexis de Lattre
d3c0ad87a7 Add module mass_mailing_usability
Improve module link_tracker_usability
2021-12-06 12:28:27 +01:00
Alexis de Lattre
5c55ac7f1c New module link_tracker_usability 2021-12-06 12:28:27 +01:00
Alexis de Lattre
4873b8bd21 [MIG] base_partner_ref from v12 to v14 2021-12-06 12:28:27 +01:00
Alexis de Lattre
5e4d1b3c8d [MIG] crm_usability from v10 to v14
New module sales_team_usability (remove translation on crm.tag, which
was in crm_usability in v10)
2021-12-06 12:28:27 +01:00
Alexis de Lattre
646833ca66 Add multi-company ir.rule for crm.lead 2021-12-06 12:28:27 +01:00
Alexis de Lattre
c656c36bd6 Add groupby on partner on opportunity search view 2021-12-06 12:28:27 +01:00
David Beal
c3da55844d FIX branding 2021-12-06 12:28:27 +01:00
Alexis de Lattre
008e88455b translate=False on 'name' field of crm.lead.tag and res.partner.category 2021-12-06 12:28:27 +01:00
Alexis de Lattre
6d6c8da3eb Work on usability of CRM 2021-12-06 12:28:27 +01:00
David Beal
243e839cd9 IMP add icons 2021-12-06 12:28:27 +01:00
clementmbr
227a6f1568 [IMP] add domain on origin and destination location for stock.moves in picking view 2021-12-06 12:28:27 +01:00
clementmbr
a9721bae90 product_usability: Improve filter domain on supplier product names 2021-12-06 12:28:27 +01:00
Alexis de Lattre
60ef95ad81 account_usability: FIX display of decimal precision of sale price in product form view 2021-12-06 12:28:27 +01:00
Alexis de Lattre
4862bbc8d6 Remove modules pos_no_product_template_menu and sale_purchase_no_product_template_menu
We won't port those modules to v14
2021-12-06 12:28:27 +01:00
Alexis de Lattre
e4c50723e3 Improve register payment wizard view 2021-12-06 12:28:27 +01:00
67 changed files with 344 additions and 1019 deletions

View File

@@ -52,7 +52,6 @@ This modules adds the following functions:
* don't attach PDF upon invoice report generation on supplier invoices/refunds
* Add filter on debit and credit amount for Move Lines
* 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:

View File

@@ -19,9 +19,6 @@
'data': [
'views/account_account_type.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_invoice_report.xml',
'views/account_journal.xml',
@@ -31,14 +28,11 @@
'views/product.xml',
'views/res_config_settings.xml',
'views/res_partner.xml',
'views/res_company.xml',
'views/account_report.xml',
'wizard/account_invoice_mark_sent_view.xml',
'wizard/account_group_generate_view.xml',
'wizard/account_payment_register_views.xml',
'security/ir.model.access.csv',
'report/invoice_report.xml',
],
'qweb': ['static/src/xml/account_payment.xml'],
'installable': True,
}

View File

@@ -6,6 +6,4 @@ from . import account_journal
from . import account_move
from . import account_partial_reconcile
from . import res_partner
from . import res_company
from . import product
from . import account_invoice_report

View File

@@ -27,7 +27,9 @@ class AccountBankStatement(models.Model):
def _check_balance_end_real_same_as_computed(self):
for stmt in self:
if not stmt.hide_bank_statement_balance:
if stmt.hide_bank_statement_balance:
continue
else:
super(AccountBankStatement, stmt)._check_balance_end_real_same_as_computed()
return True
@@ -78,8 +80,7 @@ class AccountBankStatementLine(models.Model):
def show_account_move(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
'account.action_move_line_form')
action = self.env.ref('account.action_move_line_form').read()[0]
# Note: this action is on account.move, not account.move.line !
action.update({
'views': False,

View File

@@ -14,13 +14,3 @@ class AccountIncoterms(models.Model):
for rec in self:
res.append((rec.id, '[%s] %s' % (rec.code, rec.name)))
return res
@api.model
def name_search(self, name='', args=None, operator='ilike', limit=100):
if args is None:
args = []
if name and operator == 'ilike':
recs = self.search([('code', '=ilike', name + '%')] + args, limit=limit)
if recs:
return recs.name_get()
return super().name_search(name=name, args=args, operator=operator, limit=limit)

View File

@@ -1,17 +0,0 @@
# 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

View File

@@ -16,13 +16,6 @@ class AccountJournal(models.Model):
"you don't want to enter the start/end balance manually: it "
"will prevent the display of wrong information in the accounting "
"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(
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')

View File

@@ -2,12 +2,10 @@
# @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, _
from odoo import api, fields, models
from odoo.tools import float_is_zero
from odoo.tools.misc import format_date
from odoo.osv import expression
from datetime import timedelta
from odoo.exceptions import UserError
class AccountMove(models.Model):
@@ -154,13 +152,13 @@ class AccountMove(models.Model):
""" French law requires to set sale order dates into invoice
returned string: "sale1 (date1), sale2 (date2) ..."
"""
for move in self:
sales = move.invoice_line_ids.mapped(
for inv in self:
sales = inv.invoice_line_ids.mapped(
'sale_line_ids').mapped('order_id')
dates = ["%s (%s)" % (
x.name, format_date(move.env, x.date_order))
x.name, format_date(inv.env, self.date_order))
for x in sales]
move.sale_dates = ", ".join(dates)
inv.sale_dates = ", ".join(dates)
# 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)
@@ -209,18 +207,6 @@ class AccountMove(models.Model):
self.ensure_one()
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):
_inherit = 'account.move.line'
@@ -245,8 +231,7 @@ class AccountMoveLine(models.Model):
def show_account_move_form(self):
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
'account.action_move_line_form')
action = self.env.ref('account.action_move_line_form').read()[0]
action.update({
'res_id': self.move_id.id,
'view_id': False,
@@ -266,25 +251,3 @@ class AccountMoveLine(models.Model):
rec_str = ', '.join([
'a%d' % pr.id for pr in line.matched_debit_ids + line.matched_credit_ids])
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()

View File

@@ -1,21 +0,0 @@
# 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")

View File

@@ -1,19 +0,0 @@
<?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>

View File

@@ -31,9 +31,6 @@
<field name="name" position="after">
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
</field>
<filter name="accounttype" position="after">
<filter name="group_groupby" string="Group" context="{'group_by': 'group_id'}"/>
</filter>
</field>
</record>

View File

@@ -1,33 +0,0 @@
<?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>

View File

@@ -1,22 +0,0 @@
<?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>

View File

@@ -1,32 +0,0 @@
<?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>

View File

@@ -14,38 +14,26 @@
<field name="arch" type="xml">
<tree string="Invoices Analysis">
<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_due"/>
<field name="move_type"/>
<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="fiscal_position_id" optional="hide"/>
<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="product_uom_id" groups="uom.group_uom"/>
<field name="price_subtotal" sum="1"/>
<field name="state"/>
<field name="payment_state" optional="hide"/>
</tree>
</field>
</record>
<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
<field name="context">{'search_default_current': 1, 'search_default_supplier': 1, 'group_by': ['invoice_date']}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
<field name="view_mode">pivot,graph</field>
</record>
<record id="account.action_account_invoice_report_all" model="ir.actions.act_window">
<field name="context">{'search_default_current': 1, 'search_default_customer': 1, 'group_by': ['invoice_date']}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
<field name="view_mode">pivot,graph</field>
</record>
<record id="view_account_invoice_report_pivot" model="ir.ui.view">

View File

@@ -14,17 +14,6 @@
<field name="arch" type="xml">
<field name="bank_statements_source" position="after">
<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>
</record>

View File

@@ -88,11 +88,10 @@
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
</field>
<filter name="unreconciled" position="before">
<filter name="reconciled" string="Fully Reconciled" domain="[('reconciled', '=', True)]"/>
<filter name="reconciled" string="Fully Reconciled" domain="[('full_reconcile_id', '!=', False)]"/>
</filter>
<filter name="unreconciled" position="attributes">
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
<attribute name="domain">[('reconciled', '=', False), ('balance', '!=', 0), ('account_id.reconcile', '=', True)]</attribute>
</filter>
<!--
<field name="name" position="attributes">

View File

@@ -1,27 +0,0 @@
<?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>

View File

@@ -1 +0,0 @@
from . import models

View File

@@ -1,21 +0,0 @@
# Copyright 2017-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).
{
'name': 'Mail Sender Bcc',
'version': '14.0.1.0.0',
'category': 'Mail',
'license': 'AGPL-3',
'summary': "Always send a copy of the mail to the sender",
'description': """
Mail Sender Bcc
===============
With this module, when Odoo sends an outgoing email, it adds the sender as Bcc (blind copy) of the email.
""",
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['base'],
'installable': True,
}

View File

@@ -1 +0,0 @@
from . import ir_mail_server

View File

@@ -1,27 +0,0 @@
# Copyright 2017-2022 Akretion France
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class IrMailServer(models.Model):
_inherit = 'ir.mail_server'
def build_email(
self, email_from, email_to, subject, body, email_cc=None,
email_bcc=None, reply_to=False, attachments=None,
message_id=None, references=None, object_id=False,
subtype='plain', headers=None,
body_alternative=None, subtype_alternative='plain'):
if email_from:
if email_bcc is None:
email_bcc = [email_from]
elif isinstance(email_bcc, list) and email_from not in email_bcc:
email_bcc.append(email_from)
return super().build_email(
email_from, email_to, subject, body, email_cc=email_cc,
email_bcc=email_bcc, reply_to=reply_to, attachments=attachments,
message_id=message_id, references=references, object_id=object_id,
subtype=subtype, headers=headers,
body_alternative=body_alternative, subtype_alternative=subtype_alternative)

View File

@@ -29,15 +29,4 @@
</field>
</record>
<record id="mrp_production_tree_view" model="ir.ui.view">
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
<field name="arch" type="xml">
<field name="reservation_state" position="after">
<field name="location_src_id" optional="hide" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" optional="hide" groups="stock.group_stock_multi_locations"/>
</field>
</field>
</record>
</odoo>

View File

@@ -32,7 +32,6 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
'views/product_pricelist_item.xml',
'views/product_template_view.xml',
'views/product_product.xml',
'views/product_category_view.xml',
],
'installable': True,
}

View File

@@ -2,4 +2,3 @@ from . import product_product
from . import product_template
from . import product_supplierinfo
from . import product_pricelist
from . import product_category

View File

@@ -1,13 +0,0 @@
# 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)

View File

@@ -1,21 +1,21 @@
# Copyright 2015-2021 Akretion (http://www.akretion.com)
# Copyright 2015-2020 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Raphaël Valyi <rvalyi@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models, fields
from odoo import models, fields
class ProductProduct(models.Model):
_inherit = 'product.product'
default_code = fields.Char(copy=False, tracking=10)
barcode = fields.Char(tracking=20)
weight = fields.Float(tracking=30)
active = fields.Boolean(tracking=40)
barcode_code128 = fields.Char(
compute='_compute_barcode_code128',
help="Barcode in Code128-B with start char, checksum and stop char")
default_code = fields.Char(copy=False)
# track_visibility='onchange',
# barcode = fields.Char(track_visibility='onchange',
# weight = fields.Float(track_visibility='onchange')
# active = fields.Boolean(track_visibility='onchange')
_sql_constraints = [(
# Maybe it could be better to have a constrain per company
@@ -26,32 +26,3 @@ class ProductProduct(models.Model):
'default_code_uniq',
'unique(default_code)',
'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

View File

@@ -1,4 +1,4 @@
# Copyright 2015-2021 Akretion (http://www.akretion.com)
# Copyright 2015-2020 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# @author Raphaël Valyi <rvalyi@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -21,12 +21,9 @@ class ProductTemplate(models.Model):
# are only shown in the form view of product.template, not in the form
# view of product.product
name = fields.Char(tracking=10)
barcode = fields.Char(tracking=20)
default_code = fields.Char(tracking=30)
categ_id = fields.Many2one(tracking=40)
type = fields.Selection(tracking=50)
list_price = fields.Float(tracking=60)
weight = fields.Float(tracking=70)
sale_ok = fields.Boolean(tracking=80)
purchase_ok = fields.Boolean(tracking=90)
active = fields.Boolean(tracking=100)
categ_id = fields.Many2one(tracking=20)
type = fields.Selection(tracking=30)
list_price = fields.Float(tracking=40)
sale_ok = fields.Boolean(tracking=50)
purchase_ok = fields.Boolean(tracking=60)
active = fields.Boolean(tracking=70)

View File

@@ -1,19 +0,0 @@
<?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>

View File

@@ -18,17 +18,24 @@ msgstr ""
#. module: purchase_usability
#: model_terms:ir.ui.view,arch_db:purchase_usability.purchase_order_line_search
msgid "Analytic Account"
msgstr ""
msgstr "Compte Analytique"
#. 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 "Êtes-vous sûr de vouloir annuler cette commande?"
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 ""
msgstr "État de facturation"
#. 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
#: model:ir.model,name:purchase_usability.model_res_partner
@@ -57,7 +64,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_res_partner__display_name
msgid "Display Name"
msgstr "Nom"
msgstr "Nom affiché"
#. module: purchase_usability
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__dest_address_id
@@ -69,6 +76,11 @@ msgstr "Adresse de livraison directe"
msgid "Fiscal Position"
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
#: model:ir.model.fields,field_description:purchase_usability.field_product_template__id
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__id
@@ -90,6 +102,11 @@ msgstr ""
msgid "Last Modified on"
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
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_method
#: model:ir.model.fields,help:purchase_usability.field_product_template__purchase_method
@@ -113,12 +130,12 @@ msgstr "Imprimer"
#. module: purchase_usability
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order_line__product_barcode
msgid "Product Barcode"
msgstr ""
msgstr "Code-barre produit"
#. module: purchase_usability
#: model:ir.model,name:purchase_usability.model_product_template
msgid "Product Template"
msgstr "Modèle de produit"
msgstr "Modèle d'article"
#. module: purchase_usability
#: model:ir.model,name:purchase_usability.model_purchase_order
@@ -130,7 +147,7 @@ msgstr "Commande fournisseur"
#. module: purchase_usability
#: model:ir.model,name:purchase_usability.model_purchase_order_line
msgid "Purchase Order Line"
msgstr "Ligne de commande d'achat"
msgstr "Ligne de commande fournisseur"
#. module: purchase_usability
#: model:ir.model.fields,field_description:purchase_usability.field_product_product__purchase_line_warn
@@ -162,7 +179,7 @@ msgstr ""
#. module: purchase_usability
#: model_terms:ir.ui.view,arch_db:purchase_usability.view_purchase_order_filter
msgid "Reference, Origin or Vendor Reference"
msgstr ""
msgstr "Référence, Origine ou Référence fournisseur"
#. module: purchase_usability
#: model:ir.model.fields,help:purchase_usability.field_product_product__purchase_line_warn
@@ -183,3 +200,9 @@ msgstr ""
#: model:ir.model.fields,field_description:purchase_usability.field_purchase_order__partner_ref
msgid "Vendor Reference"
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"

View File

@@ -0,0 +1,196 @@
# 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 ""

View File

@@ -4,6 +4,7 @@
from odoo import api, fields, models
from odoo.tools.misc import formatLang
from odoo.tools import float_is_zero
class PurchaseOrder(models.Model):
@@ -73,28 +74,33 @@ class PurchaseOrderLine(models.Model):
# for optional display in tree view
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
product_supplier_code = fields.Char(
compute='_compute_product_supplier_code', string='Vendor Product Code')
invoice_status = fields.Selection(
[
("no", "Nothing to Bill"),
("to invoice", "Waiting Bills"),
("invoiced", "Fully Billed"),
],
string="Billing Status",
compute="_compute_invoice_status",
store=True,
readonly=True,
default="no",
)
def _compute_product_supplier_code(self):
@api.depends("state", "qty_to_invoice", "qty_invoiced")
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:
code = False
if not line.display_type and line.product_id and line.order_id:
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 line.state not in ("purchase", "done") or line.display_type:
line.invoice_status = "no"
continue
def _get_product_purchase_description(self, product_lang):
# This is useful when you want to have the product code in a dedicated
# column in your purchase 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_lang = product_lang.with_context(display_default_code=False)
return super()._get_product_purchase_description(product_lang)
if not float_is_zero(line.qty_to_invoice, precision_digits=prec):
line.invoice_status = "to invoice"
elif float_is_zero(
line.qty_to_invoice, precision_digits=prec
) and not float_is_zero(line.qty_invoiced, precision_digits=prec):
line.invoice_status = "invoiced"
else:
line.invoice_status = "no"

View File

@@ -35,7 +35,6 @@
<attribute name="groups">analytic.group_analytic_tags</attribute>
</xpath>
<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"/>
</xpath>
</field>
@@ -132,7 +131,10 @@
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</field>
<field name="date_planned" position="after">
<field name="state"/>
<field name="state" decoration-success="state == 'purchase' or state == 'done'" decoration-warning="state == 'to approve'"
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>
</record>
@@ -145,7 +147,13 @@
<field name="partner_id" position="after">
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
</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">
<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"/>
</group>
</field>

View File

@@ -1,2 +0,0 @@
from . import models
from . import wizard

View File

@@ -1,29 +0,0 @@
# Copyright 2016-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).
{
'name': 'Sale Order Add Bom',
'version': '14.0.1.0.0',
'category': 'Sales',
'license': 'AGPL-3',
'summary': 'Wizard to select a bom from a sale order',
'description': """
This module adds a wizard *Add Kit* on the form view of a quotation that allows the user to select a 'kit' BOM: Odoo will automatically add the components of the kit as sale order lines.
The wizard *Add Kit* is also available on a draft picking.
This module has been written by Alexis de Lattre from Akretion
<alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'https://github.com/akretion/odoo-usability',
'depends': ['sale', 'mrp'],
'data': [
'wizard/sale_add_phantom_bom_view.xml',
'views/sale_order.xml',
'views/stock_picking.xml',
'security/ir.model.access.csv',
],
'installable': True,
}

View File

@@ -1 +0,0 @@
from . import mrp_bom

View File

@@ -1,11 +0,0 @@
# Copyright 2016-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).
from odoo import models, fields
class MrpBom(models.Model):
_inherit = 'mrp.bom'
sale_ok = fields.Boolean(related='product_tmpl_id.sale_ok', store=True)

View File

@@ -1,3 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_add_phantom_bom_sale,Full access on sale.add.phantom.bom wizard to sale user,model_sale_add_phantom_bom,sales_team.group_sale_salesman,1,1,1,1
access_sale_add_phantom_bom_stock,Full access on sale.add.phantom.bom wizard to stock user,model_sale_add_phantom_bom,stock.group_stock_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sale_add_phantom_bom_sale Full access on sale.add.phantom.bom wizard to sale user model_sale_add_phantom_bom sales_team.group_sale_salesman 1 1 1 1
3 access_sale_add_phantom_bom_stock Full access on sale.add.phantom.bom wizard to stock user model_sale_add_phantom_bom stock.group_stock_user 1 1 1 1

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-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).
-->
<odoo>
<record id="view_order_form" model="ir.ui.view">
<field name="name">add.bom.sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<button name="action_quotation_send" position="before">
<button name="%(sale_add_phantom_bom_action)d" type="action"
string="Add Kit" states="draft,sent"/>
</button>
</field>
</record>
</odoo>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021-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).
-->
<odoo>
<data>
<record id="view_picking_form" model="ir.ui.view">
<field name="name">add.bom.stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<button name="action_confirm" position="after">
<button name="%(sale_add_phantom_bom_action)d" type="action"
string="Add Kit" states="draft" groups="stock.group_stock_user"/>
</button>
</field>
</record>
</data>
</odoo>

View File

@@ -1 +0,0 @@
from . import sale_add_phantom_bom

View File

@@ -1,96 +0,0 @@
# Copyright 2016-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).
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from odoo.tools import float_is_zero
class SaleAddPhantomBom(models.TransientModel):
_name = 'sale.add.phantom.bom'
_description = 'Add Kit to Quotation'
@api.model
def default_get(self, fields_list):
res = super().default_get(fields_list)
if self._context.get('active_model') == 'sale.order':
res['sale_id'] = self._context['active_id']
sale = self.env['sale.order'].browse(res['sale_id'])
res['company_id'] = sale.company_id.id
elif self._context.get('active_model') == 'stock.picking':
res['picking_id'] = self._context['active_id']
picking = self.env['stock.picking'].browse(res['picking_id'])
res['company_id'] = picking.company_id.id
else:
raise UserError(_(
"The wizard can only be started from a sale order or a picking."))
return res
bom_id = fields.Many2one(
'mrp.bom', 'Kit', required=True,
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id), ('type', '=', 'phantom'), ('sale_ok', '=', True)]")
company_id = fields.Many2one('res.company', string='Company', required=True)
qty = fields.Integer(
string='Number of Kits to Add', default=1, required=True)
sale_id = fields.Many2one(
'sale.order', string='Quotation')
picking_id = fields.Many2one(
'stock.picking', string='Picking')
@api.model
def _prepare_sale_order_line(self, bom_line, sale_order, wizard_qty):
qty_in_product_uom = bom_line.product_uom_id._compute_quantity(
bom_line.product_qty,
bom_line.product_id.uom_id)
vals = {
'product_id': bom_line.product_id.id,
'product_uom_qty': qty_in_product_uom * wizard_qty,
'order_id': sale_order.id,
}
# on sale.order.line, company_id is a related field
return vals
@api.model
def _prepare_stock_move(self, bom_line, picking, wizard_qty):
product = bom_line.product_id
qty_in_product_uom = bom_line.product_uom_id._compute_quantity(
bom_line.product_qty, product.uom_id)
vals = {
'product_id': product.id,
'product_uom_qty': qty_in_product_uom * wizard_qty,
'product_uom': product.uom_id.id,
'picking_id': picking.id,
'company_id': picking.company_id.id,
'location_id': picking.location_id.id,
'location_dest_id': picking.location_dest_id.id,
'name': product.partner_ref,
}
return vals
def add(self):
self.ensure_one()
assert self.sale_id or self.picking_id, 'No related sale_id or picking_id'
if self.qty < 1:
raise UserError(_(
"The number of kits to add must be 1 or superior"))
assert self.bom_id.type == 'phantom', 'The BOM is not a kit'
if not self.bom_id.bom_line_ids:
raise UserError(_("The selected kit is empty !"))
prec = self.env['decimal.precision'].precision_get(
'Product Unit of Measure')
solo = self.env['sale.order.line']
smo = self.env['stock.move']
for line in self.bom_id.bom_line_ids:
if float_is_zero(line.product_qty, precision_digits=prec):
continue
# The onchange is played in the inherit of the create()
# of sale order line in the 'sale' module
# TODO: if needed, we could increment existing order lines
# with the same product instead of always creating new lines
if self.sale_id:
vals = self._prepare_sale_order_line(line, self.sale_id, self.qty)
solo.create(vals)
elif self.picking_id:
vals = self._prepare_stock_move(line, self.picking_id, self.qty)
smo.create(vals)

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016-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).
-->
<odoo>
<record id="sale_add_phantom_bom_form" model="ir.ui.view">
<field name="name">sale.add.phantom.bom.form</field>
<field name="model">sale.add.phantom.bom</field>
<field name="arch" type="xml">
<form>
<group name="main">
<field name="sale_id" invisible="1"/>
<field name="picking_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="bom_id" default_focus="1"/>
<field name="qty"/>
</group>
<footer>
<button name="add" type="object"
class="btn-primary" string="Add"/>
<button special="cancel" string="Cancel"/>
</footer>
</form>
</field>
</record>
<record id="sale_add_phantom_bom_action" model="ir.actions.act_window">
<field name="name">Add Kit</field>
<field name="res_model">sale.add.phantom.bom</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>

View File

@@ -18,25 +18,4 @@
</field>
</record>
<record id="view_quotation_tree" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_stock.view_quotation_tree"/>
<field name="arch" type="xml">
<field name="warehouse_id" position="after">
<field name="route_id" optional="hide"/>
</field>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_stock.view_order_tree"/>
<field name="arch" type="xml">
<field name="warehouse_id" position="after">
<field name="route_id" optional="hide"/>
</field>
</field>
</record>
</odoo>

View File

@@ -1,29 +0,0 @@
# Copyright 2015-2019 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).
{
"name": "Sale Purchase No Product Template Menu",
"version": "14.0.1.0.0",
"category": "Sale and Purchase",
"license": "AGPL-3",
"summary": "Replace product.template menu entries by product.product menu entries",
"description": """
Sale Purchase No Product Template
=================================
This module replaces the menu entries for product.template by menu entries for product.product in the *Sales* and *Purchases* menu entries. With this module, the only menu entry for product.template is in the menu *Sales > Configuration > Product Categories and Attributes*.
This module also switches to the tree view by default for Product menu entries, instead of the kanban view.
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
""",
"author": "Akretion",
"website": "http://www.akretion.com",
"depends": [
"purchase",
"sale",
],
"data": ["view.xml"],
"installable": True,
}

View File

@@ -1,29 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_purchase_no_product_template_menu
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: 2022-03-28 17:19+0200\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0\n"
#. module: sale_purchase_no_product_template_menu
#: model:ir.ui.menu,name:sale_purchase_no_product_template_menu.sale_config_product_template_menu
msgid "Product Templates"
msgstr "Modèles d'article"
#. module: sale_purchase_no_product_template_menu
#: model:ir.actions.act_window,name:sale_purchase_no_product_template_menu.product_product_action_purchased
#: model:ir.actions.act_window,name:sale_purchase_no_product_template_menu.product_product_action_sell
msgid "Products"
msgstr "Articles"

View File

@@ -1,25 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_purchase_no_product_template_menu
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \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: sale_purchase_no_product_template_menu
#: model:ir.ui.menu,name:sale_purchase_no_product_template_menu.sale_config_product_template_menu
msgid "Product Templates"
msgstr ""
#. module: sale_purchase_no_product_template_menu
#: model:ir.actions.act_window,name:sale_purchase_no_product_template_menu.product_product_action_purchased
#: model:ir.actions.act_window,name:sale_purchase_no_product_template_menu.product_product_action_sell
msgid "Products"
msgstr ""

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015-2019 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>
<!-- PURCHASE -->
<record id="product_product_action_purchased" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.product</field>
<field name="view_mode">tree,form,kanban</field>
<field name="context">{'search_default_filter_to_purchase': 1}</field>
<field name="search_view_id" eval="False"/> <!-- Force empty -->
<field name="view_id" eval="False"/> <!-- Force empty -->
</record>
<record id="purchase.menu_procurement_partner_contact_form" model="ir.ui.menu">
<field name="action" ref="product_product_action_purchased"/>
</record>
<!-- SALE -->
<!-- I'd prefer to inherit product.product_normal_action_sell and
change the "name" field, but it doesn't work with translation,
so I redefine a new menu entry -->
<record id="product_product_action_sell" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.product</field>
<field name="view_mode">tree,form,kanban</field>
<field name="context">{'search_default_filter_to_sell': 1}</field>
<field name="search_view_id" eval="False"/>
<field name="view_id" ref="product.product_product_tree_view"/>
<field name="search_view_id" ref="product.product_search_form_view"/>
</record>
<!-- To keep good translations, we re-use the product.template menu
entry and link it to product product -->
<record id="sale.menu_product_template_action" model="ir.ui.menu">
<!-- related action is "product.product_template_action" -->
<field name="action" ref="product_product_action_sell"/>
</record>
<record id="product.product_template_action" model="ir.actions.act_window">
<field name="name">Product Templates</field> <!-- native value is "Products" -->
<field name="view_mode">tree,form,kanban</field>
<field name="view_id" eval="False"/>
<field name="context">{}</field>
</record>
<!-- Create a product template menu entry in configuration -->
<menuitem id="sale_config_product_template_menu" action="product.product_template_action"
parent="sale.prod_config_main"/>
<record id="product.product_normal_action_sell" model="ir.actions.act_window">
<field name="view_mode">tree,form,kanban</field>
</record>
</odoo>

View File

@@ -12,7 +12,6 @@
'website': 'http://www.akretion.com',
'depends': [
'sale',
'account_usability', # for company view
'base_view_inheritance_extension',
],
'data': [
@@ -21,8 +20,6 @@
'views/sale_report.xml',
'views/product_pricelist_item.xml',
'views/account_move.xml',
'views/res_company.xml',
"views/res_partner.xml",
],
'installable': True,
}

View File

@@ -2,4 +2,3 @@ from . import sale_order
from . import account_move
from . import product_template
from . import res_partner
from . import res_company

View File

@@ -1,13 +0,0 @@
# 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")

View File

@@ -124,14 +124,3 @@ class SaleOrderLine(models.Model):
self.env, new_price, currency_obj=pricelist.currency_id))
}
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)

View File

@@ -1,25 +0,0 @@
<?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>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="res_partner_view_team" model="ir.ui.view">
<field name="model">res.partner</field>
<field name="inherit_id" ref="sales_team.res_partner_view_team" />
<field name="arch" type="xml">
<!-- team_id should be visible in no developper mode -->
<field name="team_id" position="attributes">
<attribute name="groups"/>
</field>
</field>
</record>
</odoo>

View File

@@ -54,9 +54,4 @@
</field>
</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>

View File

@@ -22,5 +22,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
'website': 'http://www.akretion.com',
'depends': ['stock'],
'data': ['view.xml'],
'installable': True,
'installable': False,
}

View File

@@ -1,2 +1,2 @@
from . import stock_move
from . import stock_picking

View File

@@ -0,0 +1,38 @@
# 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,
}
)

View File

@@ -12,6 +12,16 @@
name="attrs"
>{'column_invisible': [('parent.state', '=', 'done')]}</attribute>
</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>
</record>
</odoo>

View File

@@ -97,7 +97,7 @@ class StockValuationXlsx(models.TransientModel):
raise UserError(_(
"The selected inventory (%s) is not in done state.")
% self.inventory_id.display_name)
cost_method_real_count = self.env['ir.property'].sudo().search([
cost_method_real_count = self.env['ir.property'].search([
('company_id', '=', company_id),
('name', '=', 'property_cost_method'),
('value_text', '=', 'real'),

View File

@@ -79,7 +79,7 @@ class StockVariationXlsx(models.TransientModel):
else:
if self.start_date >= present:
raise UserError(_("The start date must be in the past."))
cost_method_real_count = self.env['ir.property'].sudo().search([
cost_method_real_count = self.env['ir.property'].search([
('company_id', '=', company_id),
('name', '=', 'property_cost_method'),
('value_text', '=', 'real'),

View File

@@ -1,23 +0,0 @@
# 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"],
}

View File

@@ -1,29 +0,0 @@
/* 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;
});

View File

@@ -1,31 +0,0 @@
/* 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;
});

View File

@@ -1,19 +0,0 @@
<?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>