Compare commits
7 Commits
14.0-accou
...
14.0-sale_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b378bc6f48 | ||
|
|
d3989e96d7 | ||
|
|
f1a0aa6253 | ||
|
|
c7bd3319a9 | ||
|
|
fe96425d84 | ||
|
|
cad0654983 | ||
|
|
55622ec6a9 |
@@ -15,6 +15,20 @@
|
|||||||
<button name="show_journal_items" position="after">
|
<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 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>
|
</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>
|
</field>
|
||||||
</record>
|
</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_pricelist_item.xml',
|
||||||
'views/product_template_view.xml',
|
'views/product_template_view.xml',
|
||||||
'views/product_product.xml',
|
'views/product_product.xml',
|
||||||
|
'views/uom_uom.xml',
|
||||||
'views/product_category_view.xml',
|
'views/product_category_view.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ class ProductTemplate(models.Model):
|
|||||||
sale_ok = fields.Boolean(tracking=80)
|
sale_ok = fields.Boolean(tracking=80)
|
||||||
purchase_ok = fields.Boolean(tracking=90)
|
purchase_ok = fields.Boolean(tracking=90)
|
||||||
active = fields.Boolean(tracking=100)
|
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>
|
||||||
@@ -1 +1,2 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
from . import wizard
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
'views/product_pricelist_item.xml',
|
'views/product_pricelist_item.xml',
|
||||||
'views/account_move.xml',
|
'views/account_move.xml',
|
||||||
'views/res_company.xml',
|
'views/res_company.xml',
|
||||||
|
"views/res_partner.xml",
|
||||||
],
|
],
|
||||||
'installable': True,
|
'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
|
||||||
Reference in New Issue
Block a user