Git Product home page Git Product logo

margin-analysis's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

margin-analysis

TODO: add repo description.

Available addons

addon version maintainers summary
account_invoice_margin 15.0.1.0.2 sergio-teruel Show margin in invoices
account_invoice_margin_sale 15.0.1.0.1 sergio-teruel carlosdauden Set margin in invoices from sale orders
account_invoice_margin_sale_delivered_sync 15.0.1.0.0 sergio-teruel Sync invoice margin between invoices and sale orders
product_standard_margin 15.0.1.0.1 legalsylvain Product Margin and Margin Rate
sale_elaboration_margin 15.0.2.0.0 Compute elaboration margins in sale orders lines
sale_margin_delivered 15.0.1.0.1 sergio-teruel Sale Margin Delivered
sale_margin_security 15.0.1.0.1 sergio-teruel Sale Margin Security
sale_margin_sync 15.0.1.0.2 Recompute sale margin when stock move cost price is changed
sale_report_margin 15.0.1.0.0 sergio-teruel Sale Report Margin

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

margin-analysis's People

Contributors

alvarorib avatar andrevolksdorf avatar carlosdauden avatar carlosroca13 avatar chienandalu avatar cvinh avatar gurneyalex avatar haraldpanten avatar ivorra78 avatar jgrandguillaume avatar josep-tecnativa avatar leemannd avatar legalsylvain avatar marcelsavegnago avatar nedaszilinskas avatar nileshsheliya avatar oca-git-bot avatar oca-transbot avatar oca-travis avatar pedrobaeza avatar rad0van avatar rafamarpe avatar reyes4711-s73 avatar sbidoul avatar sergio-teruel avatar victoralmau avatar weblate avatar yvaucher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

margin-analysis's Issues

account_invoice_margin: does not populate purchase_price on install

Module

account_invoice_margin

Describe the bug

When installing account_invoice_margin, the purchase_price field is expected to be populated with the product's standard_price, but it stays as zero.
Manually running _compute_purchase_price fixes it, but I can't see why this is not already being done on install - I could be missing something.

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. Install account_invoice_margin
  2. Find an Invoice using a product that has a non zero cost
  3. Check the cost invoice line column: is is zero while it should be the product cost

Expected behavior
the cost invoice line column: is is zero while it should be the product cost

Bug in account_invoice_margin

If you create an invoice without the Show Invoice Margin security group, the purchase_price field of account.invoice.line model isn't set.

Steps to reproduce:

  1. With a user who doesn't have Show Invoice Margin permission
  2. Create an invoice
  3. Give permissions to the user to see the margins (Show Invoice Margin)
  4. Press ctrl+r to reload
  5. Check the invoice line. The margin percentage will be 100% and the cost will be 0.

imagen

Can it be related to the way the view is restricted to the group?

<field name="groups_id"
eval="[(4, ref('account_invoice_margin.group_account_invoice_margin_security'))]"/>

Bug on product_margin_classification when variants product not activated on DB

Module

product_margin_classification

Describe the bug

When selecting a product margin classification on a product form, the field is empty when saving manually (and if we don't save manually as not required on v16, the field is empty when moving to another screen).

To Reproduce

Affected versions: v16

Steps to reproduce the behavior:

  1. Install module, create a margin classification in the configuration
  2. Go on a product form (product.template) and select a value on the product margin classification field
  3. Save => the field is empty (no error is displayed)

Expected behavior
3. Save => the field keeps the value selected by user

Additional context
We investigated the issue with a developer in our team @huguesdk. Issue comes from the fact that the value of this field on the product.template is overwritten by the value on the product.product.
We think that in case there is no variants products on the database (hence 1 product.product for 1 product.template), the field should be exactly the same on both models (like the field pricelist for example).

We might propose a PR to fix this in the following months depending on the need of this module for our customers in v16.
@legalsylvain fyi

AttributeError: 'account.move.line' object has no attribute 'sale_line_ids'

Hello Sergio,

when i push your module in my development branch (v13), i've got the error below.
I don't understand why because the field sale_line_ids is in the model account.move.line
Regards
Vincent

Failed to load registry
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 426, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 313, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/odoo/modules/loading.py", line 234, in load_module_graph
module.with_context(overwrite=overwrite)._update_translations()
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_module.py", line 914, in _update_translations
self.env['ir.translation']._load_module_terms(mod_names, filter_lang)
File "/home/odoo/src/odoo/odoo/addons/base/models/ir_translation.py", line 807, in _load_module_terms
res_lang.load_lang(lang)
File "/home/odoo/src/odoo/odoo/addons/base/models/res_lang.py", line 97, in load_lang
language.write({'active': True})
File "/home/odoo/src/odoo/odoo/addons/base/models/res_lang.py", line 252, in write
self.flush()
File "/home/odoo/src/odoo/odoo/models.py", line 5529, in flush
self.recompute()
File "/home/odoo/src/odoo/odoo/models.py", line 5971, in recompute
process(field)
File "/home/odoo/src/odoo/odoo/models.py", line 5955, in process
recs.mapped(field.name)
File "/home/odoo/src/odoo/odoo/models.py", line 5337, in mapped
recs = recs._mapped_func(operator.itemgetter(name))
File "/home/odoo/src/odoo/odoo/models.py", line 5296, in _mapped_func
vals = [func(rec) for rec in self]
File "/home/odoo/src/odoo/odoo/models.py", line 5296, in
vals = [func(rec) for rec in self]
File "/home/odoo/src/odoo/odoo/models.py", line 5761, in getitem
return self._fields[key].get(self, type(self))
File "/home/odoo/src/odoo/odoo/fields.py", line 1033, in get
self.compute_value(recs)
File "/home/odoo/src/odoo/odoo/fields.py", line 1147, in compute_value
records._compute_field_value(self)
File "/home/odoo/src/odoo/odoo/models.py", line 4018, in _compute_field_value
getattr(self, field.compute)()
File "/home/odoo/src/user/account_invoice_margin/models/account_invoice.py", line 85, in _compute_margin
or any(line.sale_line_ids.mapped("is_downpayment"))
AttributeError: 'account.move.line' object has no attribute 'sale_line_ids'

[16.0] sale_margin_security: error creating invoices

Module

sale_margin_security

Describe the bug

A user without the "Show Sale Margin" access group can't create invoices.

image

To Reproduce

Create an Invoice from a Sale Order, found in 16.0.

Expected behavior
A user without the "Show Sale Margin" access group can't see the margin fields, but should still be able to create Invoices as usual.

product_standard_margin: Deprecated call to decimal_precision.get_precision [15.0]

When installing product_standard_margin for 15.0 for the first time I see the following warning several times:

WARNING odoo odoo.addons.base.models.decimal_precision: Deprecated call to decimal_precision.get_precision(<application>), use digits=<application> instead

I don't know if this is really an issue but it would be good to avoid such warnings to avoid any doubts and confusion.

Migration to version 16.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

Migration to version 15.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[13.0] sale_order_margin_percent crashing in specific conditions on Cache Miss

I am setting up the margin modules for use in our organisation. I set up a Transportation as a Product of Service kind with cost of $40 but Sales Price of $0. My intention is to use this as a placeholder to be able to calculate margin in case we decide to provide transportation "for free". Now I create a SO with this Transportation service and some common Product - Acoustic Screen. Everything works as expected. However when I try to remove Acoustic Screen from SO Odoo throws a dialog like the one in screenshot. Initially I thought this was division by zero but that is handled. Upon closer inspection I found out it is a Cache miss exception but I do not know why that should happen.
image

Migration to version 17.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

Modules to migrate

  • account_invoice_margin - By @jcdrubay - #189
  • account_invoice_margin_sale - By @nedaszilinskas - #197
  • product_margin_classification
  • product_replenishment_cost
  • product_standard_margin
  • sale_margin_delivered
  • sale_margin_delivered_security
  • sale_margin_security
  • sale_margin_sync
  • sale_report_margin - By @SodexisTeam - #209

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[12.0] Some questions regarding the margin Odoo+OCA

I have some general doubts regarding the calculation of the margin that I am not very clear if it is the operation of the Odoo margin, what has been implemented in this repository and / or if some improvements can be made to calculate it.

How Odoo works
To calculate the margin in the sale_order, use the "standar_price" field in the products, which can be defined as an always fixed value (OK) or according to the category of products that this field changes (property_cost_method=real and property_valuation=real_time) according to all stock movement operations (making price averages)

[IDEA] Clarify that I think there should be a check at the product level (by default True) to define if you want to control the margin of that product in sales)

Margin calculation errors
Using the "standar_price" field of each product (calculated or not) does not seem correct to me, since the inventory valuation cost of the stock movements that "have come out" of the "stock_picking" linked to the "should be used" sale_order "in question. This clarification is very important, since even if the FIFO method is used and Odoo "reserves" the stock units that are going to come out, this does NOT mean that those actually come out (for example, if working in lots, it will be highly recommended in many cases that all the units of each product in the stock_picking are from the same lot). This clarification would (from my point of view) cause the margin to have to be calculated when the stock_picking is Done.

[IDEA]In addition to the above, I believe that there should be a cron that is run 1 time a month (for example) or manually to recalculate the margin of all orders since if "stock_landed_cost" have been created the cost per unit will be different from previously defined (generally the stock_landed_cost are created days after the merchandise has entered the warehouse and therefore units of that merchandise have already left).

Idea to define purchase_price of shipping order line according to cost of the delivery carrier
Finally, I think that it would also be a very interesting contribution, to be able to define the "real" cost of the shipments (if the shipment is made with external companies and we use the addon https://github.com/OCA/delivery-carrier/ tree / 12.0 / base_delivery_carrier_label as the base for integrations with each carrier, a "purchase_price" should be defined there) so that this cost is defined as "purchase_price" of the sale_order transport line (by default the purchase_price of that line would be 0 , if it is changed to 10, the margin of that line changes, therefore the total margin of the order and if we have defined the margin in the invoices as well). For this to work, an addon (one base and the other for each integration with each carrier) would be necessary so that we can attach the file (.xls, .txt, etc.) that the transport company gives us regarding each purchase invoice with all the "shipments" you charge us (and the cost of each one of them).

Sorry for so many questions and mixing so many topics, but it is a problem-solution that has happened to us and we do not know if ODOO + OCA provide a solution to all this and / or how.
In case some of these topics are not thought of in Odoo and can be developed in OCA, I would be delighted to help you with it.

A greeting.

`product_get_cost_field` and `stock` both use "Cost price" to name different fields

As a workaround for odoo/odoo#3396, I think the module product_get_cost_field should change the label of product.product.standard_price to something else but "Cost price", to make it clear what each field does.

PS: as it turns out, the wording in standard module stock is probably right and product_get_cost_field should not add a field labeled "Standard Price".
To avoid breaking existing installations, in the short term the field cost_price should be relabeled to another name.
In the longer term, we should strive to integrate product_get_cost_field's features deeper into the standard costing features.

Automatic tests and Pylint are not passing and in 7.0

Several modules have failing tests or pylint issues: https://travis-ci.org/OCA/margin-analysis/jobs/40980110

Migration to version 13.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-13.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[14.0] sale_margin_security: group in python fields

Is your feature request related to a problem?
If so, please provide clear and concise description of what the problem is.
A user without the "Show Sales Margin" permission can see the margin in the sales report

Describe the solution you'd like
A clear and concise description of what you want to happen.
If you don't have the "Show Sales Margin" permission you can't see the margin in the report

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Restrict visibility by security groups at the python level in the sale.report model.

Additional context
Add any other context about the feature request here.

sale_margin_security still leak the margin field in Pivot View [V15]

One of the reason to have sale_margin_security is to prevent some users to see the margin in the sales order, but the field is still appear in the pivot view of sale_order.

Module

sale_margin_security

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Affected versions: V12, V13, V14, V15

Steps to reproduce the behavior:

  1. Install the sale_margin_security
  2. Don't click the option in the user config
  3. Open the Sale Order, change the view to be Pivot View
  4. Click the measure and Margin field is still there
    image

Expected behavior
The field margin is also hidden if the user is not checked the Show Sale Margin option.

Uninstallable modules in 7.0

In the current 7.0 branch, 3 modules are non-installable as per their __openerp__.py manifest:
product_cost_incl_costs_with_bom
product_cost_incl_costs_without_bom
product_historical_margin_report

What is the actual status of those modules please? Are they simply unported but used to work in a previous version? Or are they unfinished or FUBAR in some way?

[12.0] pos_margin doesn't handle inclued/excluded taxes

Hello,
I've got a strange behaviour on pos_margin addon.

The case :
I have a product that

  • I buy 28,8โ‚ฌ tax included,
  • I sell it 32โ‚ฌ tax included
  • The margin rate is 10%
  • The margin is 3,2โ‚ฌ

When I set the product with all excluded taxes, all seems ok :

General informations :

image

Purchase tab :

image

But, as soon as set the prices with included taxes, all is going weird :

General informations :

image

Purchase tab :

image

Is their something that I don't catch on the addon settings, or the addon is mainly done for exluded taxe sales ?
Thank you for help ๐Ÿ˜„

Copy of : OCA/pos#707

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.