Compare commits
22 Commits
14-add-bom
...
14.0-sale_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b378bc6f48 | ||
|
|
d3989e96d7 | ||
|
|
f1a0aa6253 | ||
|
|
c7bd3319a9 | ||
|
|
fe96425d84 | ||
|
|
a59c2e774a | ||
|
|
cad0654983 | ||
|
|
55622ec6a9 | ||
|
|
f166fe93be | ||
|
|
b8a6cbcfea | ||
|
|
f6b10a7caa | ||
|
|
371229e9e5 | ||
|
|
1dbfd23524 | ||
|
|
9a9459f013 | ||
|
|
5a58ae0d9a | ||
|
|
b162227645 | ||
|
|
3c24e94122 | ||
|
|
400f316c7f | ||
|
|
86af01667a | ||
|
|
8967bf289a | ||
|
|
1fdaf52787 | ||
|
|
df673718e5 |
@@ -242,6 +242,17 @@ class AccountMoveLine(models.Model):
|
||||
compute='_compute_reconcile_string', string='Reconcile', store=True)
|
||||
# for optional display in tree view
|
||||
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||
balance = fields.Monetary(
|
||||
string='Balance',
|
||||
default=0.0,
|
||||
currency_field='company_currency_id',
|
||||
compute="_compute_balance",
|
||||
store=True)
|
||||
|
||||
@api.depends("credit", "debit")
|
||||
def _compute_balance(self):
|
||||
for line in self:
|
||||
line.balance = line.debit - line.credit
|
||||
|
||||
def show_account_move_form(self):
|
||||
self.ensure_one()
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
<field name="matching_number" position="after">
|
||||
<button title="View Journal Entry Form" type="object" name="show_account_move_form" icon="fa-arrow-right"/>
|
||||
</field>
|
||||
<field name="credit" position="after">
|
||||
<field name="balance" sum="Balance" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -29,4 +29,15 @@
|
||||
</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>
|
||||
|
||||
@@ -15,6 +15,20 @@
|
||||
<button name="show_journal_items" position="after">
|
||||
<button name="%(point_of_sale.action_report_pos_order_all)d" type="action" class="oe_stat_button" icon="fa-table" string="Stats" context="{'search_default_session_id': active_id}"/>
|
||||
</button>
|
||||
<xpath
|
||||
expr="//field[@name='cash_register_total_entry_encoding']/parent::group"
|
||||
position="before"
|
||||
>
|
||||
<group>
|
||||
<field
|
||||
style="text-align:right;margin:0;padding:0;"
|
||||
name="cash_register_balance_start"
|
||||
widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
string="Starting Balance"
|
||||
/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ 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/uom_uom.xml',
|
||||
'views/product_category_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
|
||||
@@ -30,3 +30,4 @@ class ProductTemplate(models.Model):
|
||||
sale_ok = fields.Boolean(tracking=80)
|
||||
purchase_ok = fields.Boolean(tracking=90)
|
||||
active = fields.Boolean(tracking=100)
|
||||
company_id = fields.Many2one(tracking=110)
|
||||
|
||||
22
product_usability/views/uom_uom.xml
Normal file
22
product_usability/views/uom_uom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- When the module stock and sale are not installed,
|
||||
there is no menu entry for UoM ! These menu entry fixes this -->
|
||||
|
||||
<menuitem id="uom_config_menu" parent="base.menu_custom"
|
||||
name="Units of Measure" sequence="150"/>
|
||||
|
||||
<menuitem id="uom_categ_config_menu" parent="uom_config_menu"
|
||||
action="uom.product_uom_categ_form_action" sequence="10" />
|
||||
|
||||
<menuitem id="uom_uom_config_menu" parent="uom_config_menu"
|
||||
action="uom.product_uom_form_action" sequence="20" />
|
||||
|
||||
</odoo>
|
||||
2
sale_order_add_bom/__init__.py
Normal file
2
sale_order_add_bom/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
29
sale_order_add_bom/__manifest__.py
Normal file
29
sale_order_add_bom/__manifest__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# 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,
|
||||
}
|
||||
1
sale_order_add_bom/models/__init__.py
Normal file
1
sale_order_add_bom/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import mrp_bom
|
||||
11
sale_order_add_bom/models/mrp_bom.py
Normal file
11
sale_order_add_bom/models/mrp_bom.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# 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)
|
||||
3
sale_order_add_bom/security/ir.model.access.csv
Normal file
3
sale_order_add_bom/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
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
|
||||
|
22
sale_order_add_bom/views/sale_order.xml
Normal file
22
sale_order_add_bom/views/sale_order.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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>
|
||||
24
sale_order_add_bom/views/stock_picking.xml
Normal file
24
sale_order_add_bom/views/stock_picking.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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>
|
||||
1
sale_order_add_bom/wizard/__init__.py
Normal file
1
sale_order_add_bom/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import sale_add_phantom_bom
|
||||
96
sale_order_add_bom/wizard/sale_add_phantom_bom.py
Normal file
96
sale_order_add_bom/wizard/sale_add_phantom_bom.py
Normal file
@@ -0,0 +1,96 @@
|
||||
# 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)
|
||||
38
sale_order_add_bom/wizard/sale_add_phantom_bom_view.xml
Normal file
38
sale_order_add_bom/wizard/sale_add_phantom_bom_view.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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>
|
||||
@@ -18,4 +18,25 @@
|
||||
</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>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
'views/product_pricelist_item.xml',
|
||||
'views/account_move.xml',
|
||||
'views/res_company.xml',
|
||||
"views/res_partner.xml",
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
15
sale_usability/views/res_partner.xml
Normal file
15
sale_usability/views/res_partner.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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>
|
||||
1
sale_usability/wizard/__init__.py
Normal file
1
sale_usability/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import sale_make_invoice_advance
|
||||
37
sale_usability/wizard/sale_make_invoice_advance.py
Normal file
37
sale_usability/wizard/sale_make_invoice_advance.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from odoo import models
|
||||
from odoo.tools import float_is_zero
|
||||
|
||||
|
||||
class SaleAdvancePaymentInv(models.TransientModel):
|
||||
_inherit = "sale.advance.payment.inv"
|
||||
|
||||
def _prepare_invoice_values(self, order, name, amount, so_line):
|
||||
"""
|
||||
Create as many invoice lines as order lines with their original
|
||||
order line taxes. Lines quantities have the ratio of the advance payment.
|
||||
"""
|
||||
invoice_vals = super()._prepare_invoice_values(order, name, amount, so_line)
|
||||
lines = []
|
||||
uom_precision_digits = self.env["decimal.precision"].precision_get(
|
||||
"Product Unit of Measure"
|
||||
)
|
||||
for line in order.order_line:
|
||||
if (
|
||||
not float_is_zero(
|
||||
# avoids taking lines like previous advance payments
|
||||
line.product_uom_qty, precision_digits=uom_precision_digits
|
||||
)
|
||||
):
|
||||
lines.append((0, 0, {
|
||||
"name": name,
|
||||
"price_unit": line.price_unit,
|
||||
"quantity": line.product_uom_qty * amount / order.amount_total,
|
||||
"product_id": line.product_id.id,
|
||||
"product_uom_id": line.product_uom.id,
|
||||
"tax_ids": [(6, 0, line.tax_id.ids)],
|
||||
"sale_line_ids": [(6, 0, [line.id])],
|
||||
"analytic_tag_ids": [(6, 0, line.analytic_tag_ids.ids)],
|
||||
"analytic_account_id": order.analytic_account_id.id or False,
|
||||
}))
|
||||
invoice_vals["invoice_line_ids"] = lines
|
||||
return invoice_vals
|
||||
0
shopinvader_usability/__init__.py
Normal file
0
shopinvader_usability/__init__.py
Normal file
18
shopinvader_usability/__manifest__.py
Normal file
18
shopinvader_usability/__manifest__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2021 Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Shopinvader Usability",
|
||||
"description": """
|
||||
Shopinvader Usability""",
|
||||
"version": "14.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"author": "Akretion",
|
||||
"website": "https://github.com/OCA/odoo-usability",
|
||||
"depends": [
|
||||
"shopinvader",
|
||||
"sale_usability",
|
||||
],
|
||||
"data": ["views/sale_views.xml"],
|
||||
"auto_install": True,
|
||||
}
|
||||
22
shopinvader_usability/views/sale_views.xml
Normal file
22
shopinvader_usability/views/sale_views.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2021 Akretion
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="sale.action_quotations" model="ir.actions.act_window">
|
||||
<field
|
||||
name="domain"
|
||||
>['&', ('state', 'in', ('draft', 'sent', 'cancel')), ('typology', '=', 'sale')]</field>
|
||||
</record>
|
||||
|
||||
<record id="sale.action_quotations_with_onboarding" model="ir.actions.act_window">
|
||||
<field
|
||||
name="domain"
|
||||
>['&', ('state', 'in', ('draft', 'sent', 'cancel')), ('typology', '=', 'sale')]</field>
|
||||
</record>
|
||||
|
||||
<record id="sale.action_quotations_salesteams" model="ir.actions.act_window">
|
||||
<field
|
||||
name="domain"
|
||||
>['&', ('state', 'in', ('draft', 'sent', 'cancel')), ('typology', '=', 'sale')]</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -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'].search([
|
||||
cost_method_real_count = self.env['ir.property'].sudo().search([
|
||||
('company_id', '=', company_id),
|
||||
('name', '=', 'property_cost_method'),
|
||||
('value_text', '=', 'real'),
|
||||
|
||||
@@ -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'].search([
|
||||
cost_method_real_count = self.env['ir.property'].sudo().search([
|
||||
('company_id', '=', company_id),
|
||||
('name', '=', 'property_cost_method'),
|
||||
('value_text', '=', 'real'),
|
||||
|
||||
Reference in New Issue
Block a user