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

[14.0] ADD account_receipt_sale #1267

Merged
merged 36 commits into from
Mar 5, 2024
Merged

Conversation

eLBati
Copy link
Member

@eLBati eLBati commented Oct 18, 2022

Depends on #1260 and #1427

Copy link
Contributor

@primes2h primes2h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 1 to 29
from odoo import models, fields, api


class Position(models.Model):
_inherit = "account.fiscal.position"
receipts = fields.Boolean(string='Receipts')

@api.model
def get_receipts_fiscal_pos(self, company_id=None):
if not company_id:
company_id = self.env.user.company_id
receipt_fiscal_pos = self.search(
[
('company_id', '=', company_id.id),
('receipts', '=', True),
],
limit=1
)
if not receipt_fiscal_pos:
# Fall back to fiscal positions without company
receipt_fiscal_pos = self.search(
[
('company_id', '=', False),
('receipts', '=', True),
],
limit=1
)

return receipt_fiscal_pos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visto quanto indicato qui direi che questa parte non serve.
O quantomeno non dovrebbe stare in questo modulo, se vogliamo che lo stesso corrisponda allo scopo di l10n_it_corrispettivi_sale della 12.0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of account_receipt_sale is essentially in its DESCRIPTION.rst
so it includes parts of l10n_it_corrispettivi and l10n_it_corrispettivi_sale

Comment on lines 1 to 21
from odoo import models, fields, api


class Partner(models.Model):
_inherit = "res.partner"
use_receipts = fields.Boolean(string='Use Receipts')

@api.onchange('use_receipts')
def onchange_use_receipts(self):
if self.use_receipts:
# Partner is receipts, assign a receipts
# fiscal position only if there is none
if not self.property_account_position_id:
company = self.company_id or self.env.company
self.property_account_position_id = \
self.env['account.fiscal.position'] \
.get_receipts_fiscal_pos(company)
else:
# Unset the fiscal position only if it was receipts
if self.property_account_position_id.receipts:
self.property_account_position_id = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vedi sopra.

Comment on lines 1 to 14
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_position_form" model="ir.ui.view">
<field name="name">account.fiscal.position.form.receipts</field>
<field name="model">account.fiscal.position</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_position_form"/>
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="receipts"/>
</field>
</field>
</record>
</odoo>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vedi sopra.

Comment on lines 1 to 14
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.form.receipts</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="groups_id" eval="[(4, ref('account.group_account_manager'))]"/>
<field name="arch" type="xml">
<group name="fiscal_information" position="inside">
<field name="use_receipts"/>
</group>
</field>
</record>
</odoo>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vedi sopra.

@primes2h
Copy link
Contributor

I'm sorry for comments in italian language, I tought i was in the italian repo (l10n-italy). 😅

@rafaelbn
Copy link
Member

rafaelbn commented Feb 2, 2023

/ocabot rebase

@rafaelbn
Copy link
Member

rafaelbn commented Feb 2, 2023

@eLBati hello! Dependency merged!

@tafaRU
Copy link
Member

tafaRU commented Jul 20, 2023

@eLBati could you please rebase in order to rebuild runboat?

@eLBati eLBati force-pushed the 14.0-account_receipt_sale branch from 15cfff9 to 34cf19e Compare July 21, 2023 10:34
Copy link

@SerM11 SerM11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested :

From back end create correctly the receipts when the flag on partner is set.
Also from e-commerce is possible to create a receipt for the SO linked to a partner with receipt flag active

On receipts don't see any information about the journal used

I don't see any menu in invoicing module for access to the receipts list (but from the single partner is possible to access their ones)

the flag "group_show_sale_receipts" (under configuration / settings / invoice --> Sale Receipt Enterprise) is a enterprise feature and require an upgrade to enterprise environment in v14 (in v16 no more).

@SerM11
Copy link

SerM11 commented Aug 3, 2023

@eLBati any news? thanks

@SirTakobi
Copy link
Contributor

I don't see any menu in invoicing module for access to the receipts list (but from the single partner is possible to access their ones)

Here is the menu:
image
you need the group account.group_sale_receipts in order to see it, have a look at https://github.com/odoo/odoo/blob/960e61e7451ef8dacd3aaa70bb148240762ab461/addons/account/views/account_menuitem.xml#L13

Copy link

@SerM11 SerM11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirTakobi thank you, can you please add this step to the readme / instructions of the module?

I did other functional test and looks good to me.
:)

@SirTakobi
Copy link
Contributor

can you please add this step to the readme / instructions of the module?

cc @eLBati

Copy link

@Sashimi22 Sashimi22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional test ok

OCA-git-bot and others added 21 commits March 5, 2024 20:45
Currently translated at 66.7% (2 of 3 strings)

Translation: l10n-italy-12.0/l10n-italy-12.0-l10n_it_corrispettivi_sale
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_corrispettivi_sale/it/
Currently translated at 100.0% (3 of 3 strings)

Translation: l10n-italy-12.0/l10n-italy-12.0-l10n_it_corrispettivi_sale
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_corrispettivi_sale/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: l10n-italy-12.0/l10n-italy-12.0-l10n_it_corrispettivi_sale
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_corrispettivi_sale/
…is used when sale orders are created programmatically, like from e-commerce
account_receipt_sale (LGPL-3) depends on account_receipt_base (AGPL-3)
@OCA-git-bot
Copy link
Contributor

Congratulations, PR rebased to 14.0.

@sergiocorato
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-1267-by-sergiocorato-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 220570b into OCA:14.0 Mar 5, 2024
7 of 9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at fbc68ce. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.