Skip to content

[14.0] ADD account_receipt_sale#1267

Merged
OCA-git-bot merged 36 commits into
OCA:14.0from
eLBati:14.0-account_receipt_sale
Mar 5, 2024
Merged

[14.0] ADD account_receipt_sale#1267
OCA-git-bot merged 36 commits into
OCA:14.0from
eLBati:14.0-account_receipt_sale

Conversation

@eLBati

@eLBati eLBati commented Oct 18, 2022

Copy link
Copy Markdown
Member

Depends on #1260 and #1427

@primes2h primes2h left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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 thread account_receipt_sale/models/partner.py Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@rafaelbn

rafaelbn commented Feb 2, 2023

Copy link
Copy Markdown
Member

/ocabot rebase

@rafaelbn

rafaelbn commented Feb 2, 2023

Copy link
Copy Markdown
Member

@eLBati hello! Dependency merged!

@tafaRU

tafaRU commented Jul 20, 2023

Copy link
Copy Markdown
Member

@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

@SerM11 SerM11 left a comment

Copy link
Copy Markdown

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

SerM11 commented Aug 3, 2023

Copy link
Copy Markdown

@eLBati any news? thanks

@SirTakobi

Copy link
Copy Markdown
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

@SerM11 SerM11 left a comment

Copy link
Copy Markdown

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
Copy Markdown
Contributor

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

cc @eLBati

@Sashimi22 Sashimi22 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Functional test ok

@eLBati eLBati force-pushed the 14.0-account_receipt_sale branch from 34cf19e to c2e5d5d Compare January 10, 2024 09:41
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
Copy Markdown
Contributor

Congratulations, PR rebased to 14.0.

@OCA-git-bot OCA-git-bot force-pushed the 14.0-account_receipt_sale branch from c0ce362 to 5a7400f Compare March 5, 2024 20:45
@sergiocorato

Copy link
Copy Markdown
Contributor

/ocabot merge nobump

@OCA-git-bot

Copy link
Copy Markdown
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
@OCA-git-bot

Copy link
Copy Markdown
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.