Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] 14.0 pos_sale_order analytic by config #47

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pos_sale_order_analytic_by_config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions pos_sale_order_analytic_by_config/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Pierrick Brun <pierrick.brun@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "POS Sale order Analytic by Config",
"version": "14.0.1.0.0",
"category": "Point Of Sale",
"author": "Akretion",
"website": "https://github.com/akretion/pos-sale-order",
"license": "AGPL-3",
"depends": [
"pos_sale_order",
"pos_analytic_by_config",
],
"data": [],
"qweb": [],
"demo": [],
"installable": True,
"auto_install": True,
}
1 change: 1 addition & 0 deletions pos_sale_order_analytic_by_config/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
15 changes: 15 additions & 0 deletions pos_sale_order_analytic_by_config/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Pierrick Brun <pierrick.brun@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class SaleOrder(models.Model):
_inherit = "sale.order"

def _compute_analytic_account_id(self):
super()._compute_analytic_account_id()
for record in self:
if record.config_id and record.config_id.account_analytic_id:
record.analytic_account_id = record.config_id.account_analytic_id

Check warning on line 15 in pos_sale_order_analytic_by_config/models/sale_order.py

View check run for this annotation

Codecov / codecov/patch

pos_sale_order_analytic_by_config/models/sale_order.py#L15

Added line #L15 was not covered by tests
1 change: 1 addition & 0 deletions pos_sale_order_analytic_by_config/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Glue module to make pos_analytic_by_config work with pos_sale_order
6 changes: 6 additions & 0 deletions setup/pos_sale_order_analytic_by_config/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading