Skip to content

Commit

Permalink
[ADD] 14.0: pos_sale_order_analytic_by_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierrick Brun authored and paradoxxxzero committed Mar 4, 2024
1 parent 964a2a1 commit 68b890e
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 0 deletions.
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,
)

0 comments on commit 68b890e

Please sign in to comment.