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

[IMP] sale_invoice_policy: Several improvements #3376

Open
wants to merge 8 commits into
base: 16.0
Choose a base branch
from

Commits on Oct 24, 2024

  1. [FIX] sale_invoice_policy: Don't use the 'required' parameter

    Don't use the 'required' parameter to compute the quantities to invoice or not.
    In fact, this should only depends on the invoice policy itself.
    rousseldenis committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    a05ed41 View commit details
    Browse the repository at this point in the history
  2. [IMP] sale_invoice_policy: Don't reuse fields in depends

    As ORM appends new depends() parameters to existing ones, simplify the writing
    rousseldenis committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    7b26e33 View commit details
    Browse the repository at this point in the history
  3. [IMP] sale_invoice_policy: Don't rely on required option to compute t…

    …he amount
    
    As for the 'qty_to_invoice' field, the 'untaxed_amount_to_invoice' field should not
    depends on the required option to compute its value
    rousseldenis committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    ddb9087 View commit details
    Browse the repository at this point in the history
  4. [IMP] sale_invoice_policy: Don't rewrite Odoo core compute method

    As we don't want to rewrite Odoo core method inside this module, we
    should not rewrite the method to compute the untaxed amount to invoice.
    
    Instead, save the product invoice policy, change it to sale order one without
    recomputing context, call the super() method and then, restore its former value.
    rousseldenis committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    269a033 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5db9c78 View commit details
    Browse the repository at this point in the history
  6. [IMP] sale_invoice_policy: Add the default behavior as sale invoice p…

    …olicy
    
    With default behavior in Odoo, the invoicing policy depends on products configuration.
    So, include this as possible value for sale order invoicing policy. Possible values are so:
    
      - Products Invoice Policy: each product applies its invoicing policy (by sale line)
      - Ordered quantities: the whole sale order will apply the invoicing policy on ordered quantities
      - Delivered Quantities: the whole sale order will apply the invoicing policy on delivered quantities
    
    That said, the 'required' configuration is no more useful as the invoicing policy is now required
    on sale order level.
    rousseldenis committed Oct 24, 2024
    Configuration menu
    Copy the full SHA
    f3af918 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2024

  1. [IMP] sale_invoice_policy: Use protecting() instead of deprecated nor…

    …ecompute()
    
    To avoid marking 'invoice_policy' product field as dirty for products temporary value,
    use the working context manager 'protecting()' instead of deprecated 'norecompute() one.
    
    Put the whole process in its own contextmanager.
    rousseldenis committed Oct 25, 2024
    Configuration menu
    Copy the full SHA
    f8ec895 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dd6f488 View commit details
    Browse the repository at this point in the history